@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 ConcurrencyServiceT - 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)
ListspinThreadsAndDoNotWaitForResult in interface ConcurrencyServiceT - 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 ConcurrencyServiceT - 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 ConcurrencyServiceR - 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 Runnables being completed.spinThreadsAndWaitForCompletion in interface ConcurrencyServiceR - 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 Runnables being completed.spinThreadsAndDoNotWaitForCompletion in interface ConcurrencyServiceR - type of Runnable being calledtaskList - the list of tasks to run