|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidad.util.ThreadLocalUtils
public final class ThreadLocalUtils
Utility functions related to ThreadLocals. This class provides utilities for managing the lifecycles of ThreadLocals. In particular, many application servers do not clean up the ThreadLocals added to the request thread before returning the request thread to its thread pool. This may have several severe side-effects, including
newRequestThreadLocal()
,
registerRequestThreadLocal(java.lang.ThreadLocal)
Nested Class Summary | |
---|---|
static class |
ThreadLocalUtils.ThreadLocalLifecycle
Integration interface implemented by an object that cleans up the ThreadLocals in a ThreadLocalManager with the specified lifetime. |
static class |
ThreadLocalUtils.ThreadLocalManager
Integration interface implemented by object holding onto ThreadLocals with a specified lifetime |
Method Summary | ||
---|---|---|
static
|
newRequestThreadLocal()
Creates and returns a new ThreadLocal that will be automatically removed from the each request thread when the request finishes. |
|
static
|
registerRequestThreadLocal(ThreadLocal<T> threadLocal)
Registers and returns the ThreadLocal to be automatically removed from the each request thread when the request finishes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> ThreadLocal<T> newRequestThreadLocal()
registerRequestThreadLocal(java.lang.ThreadLocal)
public static <T> ThreadLocal<T> registerRequestThreadLocal(ThreadLocal<T> threadLocal)
threadLocal
- ThreadLocal to register for automatic removal
newRequestThreadLocal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |