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 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 ThreadContext if there are some valuable ThreadLocal variables to share otherwise null is expected