org.directwebremoting.dwrp
Class OutputAlarm

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

public class OutputAlarm
extends BasicAlarm

An Alarm that goes off whenever output happens on a ScriptSession.

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

Nested Class Summary
protected  class OutputAlarm.AlarmScriptConduit
           
 
Field Summary
protected  ScriptConduit conduit
          A conduit to alert us if there is output
protected static org.apache.commons.logging.Log log
          The log stream
protected  int maxWaitAfterWrite
          How long do we wait after output happens in case there is more output
protected  RealScriptSession scriptSession
          The script session to monitor for output
protected  java.util.TimerTask task
          The task that causes the alarm to go off
 
Constructor Summary
OutputAlarm(RealScriptSession scriptSession, int maxWaitAfterWrite)
           
 
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

conduit

protected ScriptConduit conduit
A conduit to alert us if there is output


maxWaitAfterWrite

protected int maxWaitAfterWrite
How long do we wait after output happens in case there is more output


scriptSession

protected RealScriptSession scriptSession
The script session to monitor for output


task

protected java.util.TimerTask task
The task that causes the alarm to go off


log

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

Constructor Detail

OutputAlarm

public OutputAlarm(RealScriptSession scriptSession,
                   int maxWaitAfterWrite)
Parameters:
scriptSession - The script session to monitor
maxWaitAfterWrite - How long do we wait after output
Method Detail

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

cancel

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

Overrides:
cancel in class BasicAlarm