BEA Systems, Inc.

com.connecterra.util.event
Class AlarmClock

java.lang.Object
  extended by com.connecterra.util.event.AlarmClock
All Implemented Interfaces:
Controllable

public class AlarmClock
extends Object
implements Controllable

The alarm clock sends events at specified times in the future. A caller may use the AlarmClock.add(long, com.connecterra.util.event.EventReceiver, java.lang.Object) method of the alarm clock to schedule the delivery of a specified event to a specified event receiver, at a specified time (measured as an offset from the current time). Or, a caller may use the AbstractEventProcessor.doLater(long, com.connecterra.util.event.Event) method. The alarm clock operates an independent thread that delivers such events when their time comes.


Constructor Summary
AlarmClock()
           
 
Method Summary
 void add(long millisFromNow, EventReceiver receiver, Object event)
          Schedules an event for delivery at a specified time from now to a specified event receiver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.connecterra.util.Controllable
shutdown, terminate, waitForShutdown, waitForTermination
 

Constructor Detail

AlarmClock

public AlarmClock()
Method Detail

add

public void add(long millisFromNow,
                EventReceiver receiver,
                Object event)
Schedules an event for delivery at a specified time from now to a specified event receiver.

Parameters:
millisFromNow - The time from now, in milliseconds, at which the event will be delivered. If non-positive, the event is delivered immediately.
receiver - The event receiver that will receive the event.
event - The event to be delivered.

Documentation is available at
${DOCSWEBROOT}
Copyright 2007 BEA Systems Inc.