Package org.jboss.as.threads
Class ManagedExecutorService
- java.lang.Object
-
- org.jboss.as.threads.ManagedExecutorService
-
- All Implemented Interfaces:
Executor,ExecutorService
- Direct Known Subclasses:
ManagedJBossThreadPoolExecutorService,ManagedQueueExecutorService,ManagedQueuelessExecutorService,ManagedScheduledExecutorService
public abstract class ManagedExecutorService extends Object implements ExecutorService
- Author:
- Alexey Loubyansky
-
-
Constructor Summary
Constructors Constructor Description ManagedExecutorService(ExecutorService executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long timeout, TimeUnit unit)voidexecute(Runnable command)<T> List<Future<T>>invokeAll(Collection<? extends Callable<T>> tasks)<T> List<Future<T>>invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)<T> TinvokeAny(Collection<? extends Callable<T>> tasks)<T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)booleanisShutdown()booleanisTerminated()protected ExecutorServiceprotectExecutor(ExecutorService executor)voidshutdown()List<Runnable>shutdownNow()Future<?>submit(Runnable task)<T> Future<T>submit(Runnable task, T result)<T> Future<T>submit(Callable<T> task)
-
-
-
Constructor Detail
-
ManagedExecutorService
public ManagedExecutorService(ExecutorService executor)
-
-
Method Detail
-
protectExecutor
protected ExecutorService protectExecutor(ExecutorService executor)
-
execute
public void execute(Runnable command)
- Specified by:
executein interfaceExecutor- See Also:
Executor.execute(java.lang.Runnable)
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceExecutorService- See Also:
ExecutorService.shutdown()
-
shutdownNow
public List<Runnable> shutdownNow()
- Specified by:
shutdownNowin interfaceExecutorService- See Also:
ExecutorService.shutdownNow()
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfaceExecutorService- See Also:
ExecutorService.isShutdown()
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfaceExecutorService- See Also:
ExecutorService.isTerminated()
-
awaitTermination
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException- Specified by:
awaitTerminationin interfaceExecutorService- Throws:
InterruptedException- See Also:
ExecutorService.awaitTermination(long, java.util.concurrent.TimeUnit)
-
submit
public <T> Future<T> submit(Callable<T> task)
- Specified by:
submitin interfaceExecutorService- See Also:
ExecutorService.submit(java.util.concurrent.Callable)
-
submit
public <T> Future<T> submit(Runnable task, T result)
- Specified by:
submitin interfaceExecutorService- See Also:
ExecutorService.submit(java.lang.Runnable, java.lang.Object)
-
submit
public Future<?> submit(Runnable task)
- Specified by:
submitin interfaceExecutorService- See Also:
ExecutorService.submit(java.lang.Runnable)
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException
- Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException- See Also:
ExecutorService.invokeAll(java.util.Collection)
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException- See Also:
ExecutorService.invokeAll(java.util.Collection, long, java.util.concurrent.TimeUnit)
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException
- Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionException- See Also:
ExecutorService.invokeAny(java.util.Collection)
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionExceptionTimeoutException- See Also:
ExecutorService.invokeAny(java.util.Collection, long, java.util.concurrent.TimeUnit)
-
-