com.atlassian.sal.api.executor
Interface ThreadLocalContextManager<C>

All Known Subinterfaces:
ThreadLocalContextManager

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
 void clearThreadLocalContext()
          Clear the thread local context on the current thread.
 C getThreadLocalContext()
          Get the thread local context of the current thread.
 void setThreadLocalContext(C context)
          Set the thread local context on the current thread.
 

Method Detail

getThreadLocalContext

C getThreadLocalContext()
Get the thread local context of the current thread.

Returns:
The thread local context

setThreadLocalContext

void setThreadLocalContext(C context)
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 via getThreadLocalContext().

clearThreadLocalContext

void clearThreadLocalContext()
Clear the thread local context on the current thread.



Copyright © 2015 Atlassian. All rights reserved.