Package com.sun.corba.ee.spi.threadpool
Class ThreadStateValidator
- java.lang.Object
-
- com.sun.corba.ee.spi.threadpool.ThreadStateValidator
-
public class ThreadStateValidator extends java.lang.Object
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 Modifier and Type Field Description private static java.util.List<java.lang.Runnable>
validators
private static Exceptions
wrapper
-
Constructor Summary
Constructors Modifier Constructor Description private
ThreadStateValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkValidators()
Execute all of the validators.static void
registerValidator(java.lang.Runnable validator)
Register a thread validator (represented as a Runnable).
-
-
-
Field Detail
-
wrapper
private static final Exceptions wrapper
-
validators
private static final java.util.List<java.lang.Runnable> validators
-
-
Method Detail
-
registerValidator
public static void registerValidator(java.lang.Runnable validator)
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.
-
-