org.lightwolf
Class DelayedCallSignal

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.lightwolf.FlowSignal
                  extended by org.lightwolf.DelayedCallSignal
All Implemented Interfaces:
Serializable, Callable<Object>

public abstract class DelayedCallSignal
extends FlowSignal
implements Callable<Object>

See Also:
Serialized Form

Constructor Summary
DelayedCallSignal(long delay, TimeUnit unit)
           
 
Method Summary
 void cancel()
           
 void defaultAction()
          The signal's default action.
 long getDelay()
           
 TimeUnit getUnit()
           
protected  void notifyDone()
           
 ScheduledFuture<?> schedule()
           
<V> void
setFuture(ScheduledFuture<V> future)
           
 void waitDone()
           
 
Methods inherited from class org.lightwolf.FlowSignal
getFlow, getResult
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Constructor Detail

DelayedCallSignal

public DelayedCallSignal(long delay,
                         TimeUnit unit)
Method Detail

defaultAction

public void defaultAction()
Description copied from class: FlowSignal
The signal's default action. The behavior of this method varies and is defined by the actual signal class. Usually this method registers the flow somewhere, so it can be resumed when a certain event happens. A well-behaved flow-controller should always call this method while handling a signal.

NOTE TO IMPLEMENTORS: Document well what the implementation of your method does, specially on the method's JavaDoc. You can call FlowSignal.getFlow() to obtain the flow that have sent the signal. Inside this method, it is guaranteed that the flow will be in suspended state.

Specified by:
defaultAction in class FlowSignal

getDelay

public long getDelay()

getUnit

public TimeUnit getUnit()

setFuture

public <V> void setFuture(ScheduledFuture<V> future)

cancel

public void cancel()

schedule

public ScheduledFuture<?> schedule()

waitDone

public void waitDone()
              throws InterruptedException
Throws:
InterruptedException

notifyDone

protected final void notifyDone()