Package com.atlassian.sal.api.executor
Interface ThreadLocalContextManager<C>
public interface ThreadLocalContextManager<C>
Manager for retrieving and storing a single object which represents all thread local state.
Objects returned by this interface are opaque to callers and are entirely managed by the host application. These
objects can be safely compared using
Object.equals(Object).-
Method Summary
Modifier and TypeMethodDescriptionvoidClear the thread local context on the current thread.Get the thread local context of the current thread.voidsetThreadLocalContext(C context) Set the thread local context on the current thread.
-
Method Details
-
getThreadLocalContext
C getThreadLocalContext()Get the thread local context of the current thread.- Returns:
- The thread local context
-
setThreadLocalContext
Set the thread local context on the current thread.- Parameters:
context- The context to set- Throws:
ClassCastException- if the given context is not an instance created viagetThreadLocalContext().
-
clearThreadLocalContext
void clearThreadLocalContext()Clear the thread local context on the current thread.
-