com.atlassian.jira.util.concurrent
Class BoundedExecutor
java.lang.Object
com.atlassian.jira.util.concurrent.BoundedExecutor
- All Implemented Interfaces:
- Executor
public class BoundedExecutor
- extends Object
- implements Executor
BoundedExecutor is an Executor wrapper that bounds the number of runnables
allowed on the Executor queue. execute(Runnable)
waits if the number
of runnables already on the queue equals the maximum number of permits available.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoundedExecutor
public BoundedExecutor(ExecutorService executor,
int permits)
execute
public void execute(Runnable command)
- Specified by:
execute
in interface Executor
submit
public <T> Future<T> submit(Callable<T> task)
shutdownAndWait
public void shutdownAndWait()
- shutdown the ExecutorService and wait for it. This method is not interruptible.
shutdownAndIgnoreQueue
public void shutdownAndIgnoreQueue()
Copyright © 2002-2012 Atlassian. All Rights Reserved.