Package org.jtrim2.executor
Class GenericUpdateTaskExecutor
java.lang.Object
org.jtrim2.executor.GenericUpdateTaskExecutor
- All Implemented Interfaces:
UpdateTaskExecutor
An
UpdateTaskExecutor implementation which forwards tasks scheduled
to it to a given Executor or TaskExecutor.
Thread safety
The methods of this class are safe to use by multiple threads concurrently as required byUpdateTaskExecutor.
Synchronization transparency
The methods of this interface are not synchronization transparent.-
Constructor Summary
ConstructorsConstructorDescriptionGenericUpdateTaskExecutor(Executor taskExecutor) Creates a newGenericUpdateTaskExecutorwhich will forward its tasks to the givenTaskExecutor. -
Method Summary
-
Constructor Details
-
GenericUpdateTaskExecutor
Creates a newGenericUpdateTaskExecutorwhich will forward its tasks to the givenTaskExecutor.- Parameters:
taskExecutor- the executor to which tasks will be forwarded to. This argument cannot benull.- Throws:
NullPointerException- thrown if the specified executor isnull.
-
-
Method Details
-
execute
Submits a task which is to be executed in the future. This task may cause previously submitted tasks to be discarded an never run. Therefore the currently submitted task may get discarded by a subsequentexecutecall.Implementation note: Note that this method will not forward the specified task to the underlying executor but a different one which will execute this task.
- Specified by:
executein interfaceUpdateTaskExecutor- Parameters:
task- the task to be executed. This argument cannot benull.
-
toString
Returns the string representation of this executor in no particular format.This method is intended to be used for debugging only.
-