@Service public class StandardConcurrencyService extends java.lang.Object implements ConcurrencyService
Runnable
and Callable
.
Executors
and ExecutorService
Constructor and Description |
---|
StandardConcurrencyService() |
Modifier and Type | Method and Description |
---|---|
<R extends java.lang.Runnable> |
spinOneThreadAndDoNotWaitForCompletion(R task)
Handles the passed in
Runnable concurrently. |
<T,C extends java.util.concurrent.Callable<T>> |
spinOneThreadAndDoNotWaitForResult(C task)
Handles the passed in taskList concurrently.
|
<R extends java.lang.Runnable> |
spinThreadsAndDoNotWaitForCompletion(java.util.List<R> taskList)
Handles the passed in
List <Runnable > concurrently. |
<T,C extends java.util.concurrent.Callable<T>> |
spinThreadsAndDoNotWaitForResult(java.util.List<C> taskList)
Handles the passed in taskList concurrently.
|
<R extends java.lang.Runnable> |
spinThreadsAndWaitForCompletion(java.util.List<R> taskList)
Handles the passed in
List <Runnable > concurrently. |
<T,C extends java.util.concurrent.Callable<T>> |
spinThreadsAndWaitForResult(java.util.List<C> taskList)
Handles the passed in taskList concurrently, and returns the result.
|
public <T,C extends java.util.concurrent.Callable<T>> java.util.List<T> spinThreadsAndWaitForResult(java.util.List<C> taskList)
spinThreadsAndWaitForResult
in interface ConcurrencyService
T
- result of Callable being passedC
- type of Callable being calledtaskList
- list of tasks to runpublic <T,C extends java.util.concurrent.Callable<T>> void spinThreadsAndDoNotWaitForResult(java.util.List<C> taskList)
List
spinThreadsAndDoNotWaitForResult
in interface ConcurrencyService
T
- result of Callable being passedC
- type of Callable being calledtaskList
- list of tasks to runpublic <T,C extends java.util.concurrent.Callable<T>> void spinOneThreadAndDoNotWaitForResult(C task)
Callable
.spinOneThreadAndDoNotWaitForResult
in interface ConcurrencyService
T
- result of Callable being passedC
- type of Callable being calledtask
- the task to runpublic <R extends java.lang.Runnable> void spinOneThreadAndDoNotWaitForCompletion(R task)
Runnable
concurrently. There is no guarantee this method will execute before subsequent client code.
This method is appropriate when client code is not depending on the passed in Runnable
being completed.spinOneThreadAndDoNotWaitForCompletion
in interface ConcurrencyService
R
- type of Runnable being calledtask
- the task to runpublic <R extends java.lang.Runnable> void spinThreadsAndWaitForCompletion(java.util.List<R> taskList)
List
<Runnable
> concurrently. There is no guarantee this method will execute before
subsequent client code. This method is appropriate when client code is depending on the passed in Runnable
s being completed.spinThreadsAndWaitForCompletion
in interface ConcurrencyService
R
- type of Runnable being calledtaskList
- the list of tasks to runpublic <R extends java.lang.Runnable> void spinThreadsAndDoNotWaitForCompletion(java.util.List<R> taskList)
List
<Runnable
> concurrently. There is no guarantee this method will execute before
subsequent client code. This method is appropriate when client code is not depending on the passed in Runnable
s being completed.spinThreadsAndDoNotWaitForCompletion
in interface ConcurrencyService
R
- type of Runnable being calledtaskList
- the list of tasks to run