Package com.linecorp.armeria.common
Interface ContextAwareExecutorService
- All Superinterfaces:
AutoCloseable
,ContextAwareExecutor
,ContextHolder
,Executor
,ExecutorService
- All Known Subinterfaces:
ContextAwareBlockingTaskExecutor
,ContextAwareEventLoop
,ContextAwareScheduledExecutorService
A delegating
ExecutorService
that makes sure all submitted tasks are
executed within the RequestContext
.-
Method Summary
Modifier and TypeMethodDescriptioncontext()
Returns theRequestContext
that was specified when creating thisContextAwareExecutorService
.static ContextAwareExecutorService
of
(RequestContext context, ExecutorService executor) Returns a newContextAwareExecutorService
that sets the specifiedRequestContext
before executing any submitted tasks.Returns theExecutorService
that executes the submitted tasks without setting theRequestContext
.Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, close, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
Method Details
-
of
Returns a newContextAwareExecutorService
that sets the specifiedRequestContext
before executing any submitted tasks. -
context
RequestContext context()Returns theRequestContext
that was specified when creating thisContextAwareExecutorService
.- Specified by:
context
in interfaceContextAwareExecutor
- Specified by:
context
in interfaceContextHolder
-
withoutContext
ExecutorService withoutContext()Returns theExecutorService
that executes the submitted tasks without setting theRequestContext
.- Specified by:
withoutContext
in interfaceContextAwareExecutor
-