Class JmcExecutorService
java.lang.Object
org.mpi_sws.jmc.api.util.concurrent.JmcExecutorService
- All Implemented Interfaces:
AutoCloseable,Executor,ExecutorService
An executor service that runs tasks in new threads. It is a redefinition of
ExecutorService for JMC model checking.
Currently, the executor service does not support stopping tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long l, TimeUnit timeUnit) Waits for the executor service to terminate.voidinvokeAll(Collection<? extends Callable<T>> collection) invokeAll(Collection<? extends Callable<T>> collection, long l, TimeUnit timeUnit) <T> TinvokeAny(Collection<? extends Callable<T>> collection) <T> TinvokeAny(Collection<? extends Callable<T>> collection, long l, TimeUnit timeUnit) booleanReturns whether the executor service is shutdown.booleanReturns whether the executor service is terminated.voidshutdown()Stops the executor service.Stops the executor service.JmcFuture<?> <T> JmcFuture<T> <T> JmcFuture<T> Submits a callable task to the executor service.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
close
-
Constructor Details
-
JmcExecutorService
public JmcExecutorService(int capacity)
-
-
Method Details
-
shutdown
public void shutdown()Stops the executor service.- Specified by:
shutdownin interfaceExecutorService
-
shutdownNow
Stops the executor service. Currently not supported.- Specified by:
shutdownNowin interfaceExecutorService
-
isShutdown
public boolean isShutdown()Returns whether the executor service is shutdown.- Specified by:
isShutdownin interfaceExecutorService
-
isTerminated
public boolean isTerminated()Returns whether the executor service is terminated.- Specified by:
isTerminatedin interfaceExecutorService
-
awaitTermination
Waits for the executor service to terminate.- Specified by:
awaitTerminationin interfaceExecutorService- Throws:
InterruptedException
-
submit
Submits a callable task to the executor service.- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection) throws InterruptedException - Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection, long l, TimeUnit timeUnit) throws InterruptedException - Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> collection) throws InterruptedException, ExecutionException - Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> collection, long l, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
execute
-