net.i2p.util
Class SimpleTimer

java.lang.Object
  extended bynet.i2p.util.SimpleTimer

public class SimpleTimer
extends java.lang.Object

Simple event scheduler - toss an event on the queue and it gets fired at the appropriate time. The method that is fired however should NOT block (otherwise they b0rk the timer).


Nested Class Summary
static interface SimpleTimer.TimedEvent
          Simple interface for events to be queued up and notified on expiration
 
Method Summary
 void addEvent(SimpleTimer.TimedEvent event, long timeoutMs)
          Queue up the given event to be fired no sooner than timeoutMs from now
static SimpleTimer getInstance()
           
 boolean removeEvent(SimpleTimer.TimedEvent evt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SimpleTimer getInstance()

addEvent

public void addEvent(SimpleTimer.TimedEvent event,
                     long timeoutMs)
Queue up the given event to be fired no sooner than timeoutMs from now


removeEvent

public boolean removeEvent(SimpleTimer.TimedEvent evt)