Interface ThreadContextHolder
- All Known Implementing Classes:
AbstractContext,ContextManagerImpl,RequestContext,SessionContext,SharedContext,UnSharedContext
public interface ThreadContextHolder
Defines a component that holds variables of type ThreadLocal
whose value is required by the component to work normally and cannot be recovered.
This component is mainly used when we want to do a task asynchronously, in that case
to ensure that the task will be executed in the same conditions as if it would be
executed synchronously we need to transfer the thread context from the original
thread to the executor thread.
Warning please note that this interface must be used with caution, only
the most important components that have ThreadLocal variables whose value
cannot be recovered should implement this interface.
- Version:
- $Id$
- Author:
- Nicolas Filotto
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGives the value corresponding to the context of the thread
-
Field Details
-
MANAGE_THREAD_LOCAL
-
-
Method Details
-
getThreadContext
ThreadContext getThreadContext()Gives the value corresponding to the context of the thread- Returns:
- a new instance of
ThreadContextif there are some valuableThreadLocalvariables to share otherwisenullis expected
-