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 ThreadContext
Returns an instanceThreadContext
or null.void
Removes the currentThreadContext
.void
setCurrentContext
(ThreadContext threadContext) Sets the currentThreadContext
.io.vavr.control.Try<ThreadContext>
Returns aTry
of the currentThreadContext
.
-
Method Details
-
tryGetCurrentContext
Returns aTry
of the currentThreadContext
.- Returns:
- A
Try
of the currentThreadContext
.
-
setCurrentContext
Sets the currentThreadContext
.- Parameters:
threadContext
- TheThreadContext
to set.
-
removeCurrentContext
void removeCurrentContext()Removes the currentThreadContext
. -
getCurrentContextOrNull
Returns an instanceThreadContext
or null.- Returns:
- A
ThreadContext
or null.
-