|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.util.SimpleTimer
public class SimpleTimer
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). WARNING - Deprecated. This is an inefficient mess. Use SimpleScheduler or SimpleTimer2 if possible.
Nested Class Summary | |
---|---|
static interface |
SimpleTimer.TimedEvent
Simple interface for events to be queued up and notified on expiration |
Constructor Summary | |
---|---|
SimpleTimer(I2PAppContext context)
Deprecated. use SimpleTimer2 |
Method Summary | |
---|---|
void |
addEvent(SimpleTimer.TimedEvent event,
long timeoutMs)
Queue up the given event to be fired no sooner than timeoutMs from now. |
void |
addEvent(SimpleTimer.TimedEvent event,
long timeoutMs,
boolean useEarliestTime)
|
static SimpleTimer |
getInstance()
Deprecated. use SimpleTimer2 |
boolean |
removeEvent(SimpleTimer.TimedEvent evt)
|
void |
removeSimpleTimer()
Removes the SimpleTimer. |
void |
reschedule(SimpleTimer.TimedEvent event,
long timeoutMs)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleTimer(I2PAppContext context)
Method Detail |
---|
public static SimpleTimer getInstance()
public void removeSimpleTimer()
public void reschedule(SimpleTimer.TimedEvent event, long timeoutMs)
event
- timeoutMs
- public void addEvent(SimpleTimer.TimedEvent event, long timeoutMs)
event
- timeoutMs
- public void addEvent(SimpleTimer.TimedEvent event, long timeoutMs, boolean useEarliestTime)
event
- timeoutMs
- useEarliestTime
- if its already scheduled, use the earlier of the
two timeouts, else use the laterpublic boolean removeEvent(SimpleTimer.TimedEvent evt)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |