public class ExecutorServiceThrottle extends AbstractExecutorService
ExecutorService
that limits the number of Runnable
s
running.
Work will be executed in the order in which it was submitted.
Constructor and Description |
---|
ExecutorServiceThrottle(ExecutorService delegate,
int threads) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
execute(Runnable command) |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown() |
List<Runnable> |
shutdownNow() |
String |
toString() |
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public ExecutorServiceThrottle(ExecutorService delegate, int threads)
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
InterruptedException
public boolean isShutdown()
public boolean isTerminated()
public void shutdown()
public void execute(Runnable command)