Package org.jtrim2.executor
Interface ContextAwareTaskExecutor
- All Superinterfaces:
Executor,TaskExecutor
- All Known Subinterfaces:
ContextAwareTaskExecutorService,MonitorableTaskExecutor,MonitorableTaskExecutorService
- All Known Implementing Classes:
ContextAwareWrapper,SingleThreadedExecutor,SyncTaskExecutor,ThreadPoolTaskExecutor
Defines a
TaskExecutor which is able to decide whether the currently
running code is executing in the context of the executor or not.
Thread safety
Implementations of this interface are required to be safely accessible from multiple threads concurrently.Synchronization transparency
The methods of this interface are not required to be synchronization transparent because they may execute tasks, handlers added toCompletionStage, etc.-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the calling code is executing in the context of this executor.Methods inherited from interface org.jtrim2.executor.TaskExecutor
execute, execute, executeFunction, executeStaged
-
Method Details
-
isExecutingInThis
boolean isExecutingInThis()Returnstrueif the calling code is executing in the context of this executor. That is, it is executed by a task submitted to this executor.This method can be used to check that a method call is executing in the context it was designed for.
- Returns:
trueif the calling code is executing in the context of this executor,falseotherwise
-