Class TapirTaskExecutor
- java.lang.Object
-
- de.bmiag.tapir.execution.executor.TapirTaskExecutor
-
@Component("tapirTaskExecutor") public class TapirTaskExecutor extends java.lang.Object
TheTapirTaskExecutor
is responsible for executing Runnables which are registered viasubmit(CompletionService, Callable)
. The implementation delegates to theThreadPoolTaskExecutor
. TheTapirTaskExecutor
is aware of the thread scope and clears is accordingly.- Since:
- 2.0.0
- Author:
- Oliver Libutzki <[email protected]>
- See Also:
ThreadPoolTaskExecutor
-
-
Constructor Summary
Constructors Constructor Description TapirTaskExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> java.util.concurrent.CompletionService<V>
getCompletionService()
Returns theCompletionService
.void
shutdown()
This method shuts down the underlying executor.<V> java.util.concurrent.Future<V>
submit(java.util.concurrent.CompletionService<V> completionService, java.util.concurrent.Callable<V> callable)
Executes the givenCallable
and returns aFuture
.
-
-
-
Method Detail
-
shutdown
@PreDestroy public void shutdown()
This method shuts down the underlying executor.- Since:
- 2.0.0
-
getCompletionService
public <V> java.util.concurrent.CompletionService<V> getCompletionService()
Returns theCompletionService
.- Type Parameters:
V
- the result type of the completion service- Returns:
- the completion service
- Since:
- 2.0.0
-
submit
public <V> java.util.concurrent.Future<V> submit(java.util.concurrent.CompletionService<V> completionService, java.util.concurrent.Callable<V> callable)
Executes the givenCallable
and returns aFuture
.- Type Parameters:
V
- the result type of the givenCallable
- Parameters:
completionService
- the completion servicecallable
- the callable to be executed- Returns:
- the future of the execution
- Since:
- 2.0.0
-
-