public class ExecutorServiceThrottle
extends java.util.concurrent.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(java.util.concurrent.ExecutorService delegate,
int threads) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
execute(java.lang.Runnable command) |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow() |
java.lang.String |
toString() |
public ExecutorServiceThrottle(java.util.concurrent.ExecutorService delegate, int threads)
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean isShutdown()
public boolean isTerminated()
public void shutdown()
public java.util.List<java.lang.Runnable> shutdownNow()
public void execute(java.lang.Runnable command)
public java.lang.String toString()
toString
in class java.lang.Object