org.directwebremoting.impl
Class ShutdownAlarm

java.lang.Object
  extended by org.directwebremoting.impl.ShutdownAlarm
All Implemented Interfaces:
Alarm

public class ShutdownAlarm
extends java.lang.Object
implements Alarm

An Alarm that allows the system to close all connections when it is shutting down.

WARNING: This code has a non-obvious side effect - The server load monitor (which hands out shutdown messages) also monitors usage by looking at the number of connected alarms.

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

Constructor Summary
ShutdownAlarm(Sleeper sleeper, ServerLoadMonitor serverLoadMonitor)
          Register ourselves with the ServerLoadMonitor so we can raise an Alarm if we get shutdown
 
Method Summary
 void cancel()
          Prevent further calls to Sleeper.wakeUp().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShutdownAlarm

public ShutdownAlarm(Sleeper sleeper,
                     ServerLoadMonitor serverLoadMonitor)
Register ourselves with the ServerLoadMonitor so we can raise an Alarm if we get shutdown

Parameters:
serverLoadMonitor -
Method Detail

cancel

public void cancel()
Description copied from interface: Alarm
Prevent further calls to Sleeper.wakeUp(). See the note about late calls above.

Specified by:
cancel in interface Alarm

Copyright 2008