Interface ThreadContext<T>
-
- All Known Implementing Classes:
ResteasyThreadContext
public interface ThreadContext<T>
A utility used to capture the current context and set it on a thread before it's execute. Finally resetting the context.- Since:
- 5.0.0
- Author:
- James R. Perkins
- See Also:
ContextualExecutorService
,ContextualScheduledExecutorService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
capture()
Captures the current context to be passed topush(Object)
before a thread executes.void
push(T context)
Pushes the context previously captured to the currently running thread.void
reset(T context)
Resets the context on the current thread.
-
-
-
Method Detail
-
capture
T capture()
Captures the current context to be passed topush(Object)
before a thread executes.- Returns:
- the current context
-
push
void push(T context)
Pushes the context previously captured to the currently running thread.- Parameters:
context
- the captured context to push
-
reset
void reset(T context)
Resets the context on the current thread.- Parameters:
context
- the captured context to reset
-
-