com.realtime.xmpp.util
Class TimeoutEvent

java.lang.Object
  |
  +--com.realtime.xmpp.util.TimeoutEvent

public class TimeoutEvent
extends java.lang.Object

Manage an event queue. Events are created by instantiating a TimeoutEvent object. A single thread monitors for timeouts and fires events through the Handler interface.

This class does not guarantee timeliness.

Version:
1.0 Copyright © 2002 Real Time Entertainment Group, LLC - All rights reserved.
Author:
Mike Prince

Nested Class Summary
static interface TimeoutEvent.Handler
          Interface the event handlers must implement.
protected  class TimeoutEvent.TimeoutDaemon
          Daemon to wait for events and signal handlers.
 
Field Summary
protected static TimeoutEvent.TimeoutDaemon m_daemon
          Our single daemon.
protected  TimeoutEvent.Handler m_handler
          The handler to signal when the timeout occurs.
protected  long m_timeout
          Absolute system time of this timeout.
protected static java.util.List m_timeoutEvents
          The list of timeout event objects in chronological order.
 
Constructor Summary
TimeoutEvent(long timeout, TimeoutEvent.Handler handler)
          Create a new timeout event and place it in the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_timeout

protected long m_timeout
Absolute system time of this timeout.


m_handler

protected TimeoutEvent.Handler m_handler
The handler to signal when the timeout occurs.


m_daemon

protected static TimeoutEvent.TimeoutDaemon m_daemon
Our single daemon.


m_timeoutEvents

protected static java.util.List m_timeoutEvents
The list of timeout event objects in chronological order.

Constructor Detail

TimeoutEvent

public TimeoutEvent(long timeout,
                    TimeoutEvent.Handler handler)

Create a new timeout event and place it in the queue.

* @param timeout the number of millis to wait before calling the handler.

Parameters:
handler - The handler to signal once the time has elapsed.


Copyright © 2002,2003 Real Time Entertainment Group, LLC. All Rights Reserved.