org.directwebremoting.dwrp
Class TimedAlarm

java.lang.Object
  extended by org.directwebremoting.dwrp.BasicAlarm
      extended by org.directwebremoting.dwrp.TimedAlarm

public class TimedAlarm
extends BasicAlarm

An Alarm that goes off after a certain length of time.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Field Summary
protected static org.apache.commons.logging.Log log
          The log stream
protected  long waitTime
          How long do we wait for?
 
Constructor Summary
TimedAlarm(long waitTime)
           
 
Method Summary
 void cancel()
          Prevent further calls to Sleeper.wakeUp().
 void setAlarmAction(org.directwebremoting.dwrp.Sleeper sleeper)
          Alarms need something to do when they go off.
 
Methods inherited from class org.directwebremoting.dwrp.BasicAlarm
raiseAlarm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

waitTime

protected long waitTime
How long do we wait for?


log

protected static final org.apache.commons.logging.Log log
The log stream

Constructor Detail

TimedAlarm

public TimedAlarm(long waitTime)
Parameters:
waitTime - How long we wait before the Alarm goes off
Method Detail

cancel

public void cancel()
Prevent further calls to Sleeper.wakeUp(). See the note about late calls above.

Overrides:
cancel in class BasicAlarm

setAlarmAction

public void setAlarmAction(org.directwebremoting.dwrp.Sleeper sleeper)
Alarms need something to do when they go off. After this method has been called the Alarm may 'go off', once only, by calling Sleeper.wakeUp().

Overrides:
setAlarmAction in class BasicAlarm
Parameters:
sleeper - The action to awake when the alarm goes off