Interface ThreadContextHolder
-
- All Known Implementing Classes:
AbstractContext,ContextManagerImpl,RequestContext,SessionContext,SharedContext,UnSharedContext
public interface ThreadContextHolderDefines a component that holds variables of type
ThreadLocalwhose 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
ThreadLocalvariables whose value cannot be recovered should implement this interface.- Version:
- $Id$
- Author:
- Nicolas Filotto
-
-
Field Summary
Fields Modifier and Type Field Description static PermissionMANAGE_THREAD_LOCAL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ThreadContextgetThreadContext()Gives the value corresponding to the context of the thread
-
-
-
Field Detail
-
MANAGE_THREAD_LOCAL
static final Permission MANAGE_THREAD_LOCAL
-
-
Method Detail
-
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
-
-