Interface ThreadContextDecorator
- All Known Implementing Classes:
SecurityContextThreadContextDecorator
public interface ThreadContextDecorator
Enables decorating a callable before it is scheduled for asynchronous execution by the
DefaultThreadContextExecutorService
. This enables passing on ThreadLocal values to newly created threads.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Defines the default priorities for decorators. -
Method Summary
Modifier and TypeMethodDescription<T> Callable<T>
decorateCallable
(Callable<T> callable) Enhance an operation with specific behaviour to be applied around its execution.int
Returns the priority that defines the order in which decorators are applied.
-
Method Details
-
getPriority
int getPriority()Returns the priority that defines the order in which decorators are applied. Smaller priorities are applied first. Negative number must not be used as they are reserved for internal use.- Returns:
- The priority indicator.
-
decorateCallable
Enhance an operation with specific behaviour to be applied around its execution. Decoration means returning a new callable which itself will eventually call the given callable.- Type Parameters:
T
- Callable generic return type.- Parameters:
callable
- The callable to be decorated.- Returns:
- The new, enhanced callable.
-