org.mule.util.concurrent
Class WaitPolicy

java.lang.Object
  extended by org.mule.util.concurrent.WaitPolicy
All Implemented Interfaces:
RejectedExecutionHandler

public class WaitPolicy
extends Object
implements RejectedExecutionHandler

A handler for unexecutable tasks that waits until the task can be submitted for execution or times out. Generously snipped from the jsr166 repository at: .


Constructor Summary
WaitPolicy()
          Constructs a WaitPolicy which waits (almost) forever.
WaitPolicy(long time, TimeUnit timeUnit)
          Constructs a WaitPolicy with timeout.
 
Method Summary
 void rejectedExecution(Runnable r, ThreadPoolExecutor e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaitPolicy

public WaitPolicy()
Constructs a WaitPolicy which waits (almost) forever.


WaitPolicy

public WaitPolicy(long time,
                  TimeUnit timeUnit)
Constructs a WaitPolicy with timeout. A negative time value is interpreted as Long.MAX_VALUE.

Method Detail

rejectedExecution

public void rejectedExecution(Runnable r,
                              ThreadPoolExecutor e)
Specified by:
rejectedExecution in interface RejectedExecutionHandler


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.