|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.util.SimpleTimer2
public class SimpleTimer2
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). This rewrites the old SimpleTimer to use the java.util.concurrent.ScheduledThreadPoolExecutor. SimpleTimer has problems with lock contention; this should work a lot better. This supports cancelling and arbitrary rescheduling. If you don't need that, use SimpleScheduler instead. SimpleTimer is deprecated, use this or SimpleScheduler.
Nested Class Summary | |
---|---|
static class |
SimpleTimer2.TimedEvent
Similar to SimpleTimer.TimedEvent but users must extend instead of implement, and all schedule and cancel methods are through this class rather than SimpleTimer2. |
Constructor Summary | |
---|---|
|
SimpleTimer2(I2PAppContext context)
To be instantiated by the context. |
protected |
SimpleTimer2(I2PAppContext context,
String name)
To be instantiated by the context. |
protected |
SimpleTimer2(I2PAppContext context,
String name,
boolean prestartAllThreads)
To be instantiated by the context. |
Method Summary | |
---|---|
static SimpleTimer2 |
getInstance()
If you have a context, use context.simpleTimer2() instead |
void |
stop()
Stops the SimpleTimer. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleTimer2(I2PAppContext context)
protected SimpleTimer2(I2PAppContext context, String name)
protected SimpleTimer2(I2PAppContext context, String name, boolean prestartAllThreads)
Method Detail |
---|
public static SimpleTimer2 getInstance()
public void stop()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |