com.atlassian.jira.util.concurrent
Class BoundedExecutor

java.lang.Object
  extended by com.atlassian.jira.util.concurrent.BoundedExecutor
All Implemented Interfaces:
edu.emory.mathcs.backport.java.util.concurrent.Executor

public class BoundedExecutor
extends Object
implements edu.emory.mathcs.backport.java.util.concurrent.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.


Constructor Summary
BoundedExecutor(edu.emory.mathcs.backport.java.util.concurrent.ExecutorService executor, int permits)
           
 
Method Summary
 void execute(Runnable command)
           
 void shutdownAndIgnoreQueue()
           
 void shutdownAndWait()
          shutdown the ExecutorService and wait for it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundedExecutor

public BoundedExecutor(edu.emory.mathcs.backport.java.util.concurrent.ExecutorService executor,
                       int permits)
Method Detail

execute

public void execute(Runnable command)
Specified by:
execute in interface edu.emory.mathcs.backport.java.util.concurrent.Executor

shutdownAndWait

public void shutdownAndWait()
shutdown the ExecutorService and wait for it. This method is not interruptible.


shutdownAndIgnoreQueue

public void shutdownAndIgnoreQueue()


Copyright © 2002-2008 Atlassian. All Rights Reserved.