Package com.sun.corba.ee.spi.threadpool
Class ThreadStateValidator
java.lang.Object
com.sun.corba.ee.spi.threadpool.ThreadStateValidator
Interface to support thread state validation. The basic idea is that
one or more validators can be registered with an implementation of the
TSV. The validators are executed whenever a thread is returned to the
threadpool, For example, a validator may check for unreleased locks or uncleared
threadlocals. This is intended as a last-ditch backstop for leaking resource
problems.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Execute all of the validators.static void
registerValidator
(Runnable validator) Register a thread validator (represented as a Runnable).
-
Field Details
-
wrapper
-
validators
-
-
Constructor Details
-
ThreadStateValidator
private ThreadStateValidator()
-
-
Method Details
-
registerValidator
Register a thread validator (represented as a Runnable). A validator may check for locks that should not be held, check for threadlocals that should be cleared, or take any other action to check for resources that should not be held once the thread is no longer needed, as signaled by the thread being returned to the threadpool.A validator typically may take the following actions:
- Check whether or not a resource has been released.
- Log any detected problems.
- Reclaim the resource.
- Parameters:
validator
-
-
checkValidators
public static void checkValidators()Execute all of the validators. Should only be called from the threadpool implementation.
-