naga.eventmachine
Interface DelayedEvent


public interface DelayedEvent

A cancellable, delayed event posted to the event service.

Author:
Christoffer Lerno

Method Summary
 void cancel()
          Cancels this delayed event.
 java.lang.Runnable getCall()
          Returns the actual Runnable to be executed when this event runs.
 long getTime()
          Returns the time when this event will execute.
 

Method Detail

cancel

void cancel()
Cancels this delayed event.

Note that cancelling a delayed event is *not* guaranteed to remove the event from the queue. But it is guaranteed to clear the reference to the Runnable associated with the event. The method may be called multiple times with no ill effect.

Cancelling an event while it is executing will not prevent it from executing.

This metod is thread-safe.


getCall

java.lang.Runnable getCall()
Returns the actual Runnable to be executed when this event runs.

This will value will be null if this event has been cancelled.

Returns:
the call to execute with this event runs, or null if this event is cancelled.

getTime

long getTime()
Returns the time when this event will execute. See Date#getTime().

Returns:
a long representing the time when this event will occur.