Package org.matsim.contrib.util
Class ExecutorServiceWithResource<R>
- java.lang.Object
-
- org.matsim.contrib.util.ExecutorServiceWithResource<R>
-
public class ExecutorServiceWithResource<R> extends Object
- Author:
- michalm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ExecutorServiceWithResource.CallableWithResource<V,R>
static interface
ExecutorServiceWithResource.RunnableWithResource<R>
-
Constructor Summary
Constructors Constructor Description ExecutorServiceWithResource(Collection<R> resources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
shutdown()
<V> Future<V>
submitCallable(ExecutorServiceWithResource.CallableWithResource<V,R> task)
<V> List<Future<V>>
submitCallables(Stream<ExecutorServiceWithResource.CallableWithResource<V,R>> tasks)
<V> List<V>
submitCallablesAndGetResults(Stream<ExecutorServiceWithResource.CallableWithResource<V,R>> tasks)
Future<?>
submitRunnable(ExecutorServiceWithResource.RunnableWithResource<R> task)
List<Future<?>>
submitRunnables(Stream<ExecutorServiceWithResource.RunnableWithResource<R>> tasks)
void
submitRunnablesAndWait(Stream<ExecutorServiceWithResource.RunnableWithResource<R>> tasks)
-
-
-
Constructor Detail
-
ExecutorServiceWithResource
public ExecutorServiceWithResource(Collection<R> resources)
-
-
Method Detail
-
submitCallable
public <V> Future<V> submitCallable(ExecutorServiceWithResource.CallableWithResource<V,R> task)
-
submitCallables
public <V> List<Future<V>> submitCallables(Stream<ExecutorServiceWithResource.CallableWithResource<V,R>> tasks)
-
submitCallablesAndGetResults
public <V> List<V> submitCallablesAndGetResults(Stream<ExecutorServiceWithResource.CallableWithResource<V,R>> tasks)
-
submitRunnable
public Future<?> submitRunnable(ExecutorServiceWithResource.RunnableWithResource<R> task)
-
submitRunnables
public List<Future<?>> submitRunnables(Stream<ExecutorServiceWithResource.RunnableWithResource<R>> tasks)
-
submitRunnablesAndWait
public void submitRunnablesAndWait(Stream<ExecutorServiceWithResource.RunnableWithResource<R>> tasks)
-
shutdown
public void shutdown()
-
-