org.oddjob.scheduling
Class ExecutorServiceThrottle
java.lang.Object
java.util.concurrent.AbstractExecutorService
org.oddjob.scheduling.ExecutorServiceThrottle
- All Implemented Interfaces:
- Executor, ExecutorService
public class ExecutorServiceThrottle
- extends AbstractExecutorService
An ExecutorService
that limits the number of Runnable
s
running.
Work will be executed in the order in which it was submitted.
- Author:
- rob
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExecutorServiceThrottle
public ExecutorServiceThrottle(ExecutorService delegate,
int threads)
awaitTermination
public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
- Throws:
InterruptedException
isShutdown
public boolean isShutdown()
isTerminated
public boolean isTerminated()
shutdown
public void shutdown()
shutdownNow
public List<Runnable> shutdownNow()
execute
public void execute(Runnable command)