Interface ThreadContextFacade
- All Known Implementing Classes:
ThreadLocalThreadContextFacade
public interface ThreadContextFacade
This class provides an abstraction for accessing the current
ThreadContext.-
Method Summary
Modifier and TypeMethodDescriptiondefault ThreadContextReturns an instanceThreadContextor null.voidRemoves the currentThreadContext.voidsetCurrentContext(ThreadContext threadContext) Sets the currentThreadContext.io.vavr.control.Try<ThreadContext>Returns aTryof the currentThreadContext.
-
Method Details
-
tryGetCurrentContext
Returns aTryof the currentThreadContext.- Returns:
- A
Tryof the currentThreadContext.
-
setCurrentContext
Sets the currentThreadContext.- Parameters:
threadContext- TheThreadContextto set.
-
removeCurrentContext
void removeCurrentContext()Removes the currentThreadContext. -
getCurrentContextOrNull
Returns an instanceThreadContextor null.- Returns:
- A
ThreadContextor null.
-