RetransmissionTimer
public class SimpleTimer2
extends java.lang.Object
修飾子とタイプ | クラス | 説明 |
---|---|---|
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.
|
修飾子 | コンストラクタ | 説明 |
---|---|---|
|
SimpleTimer2(I2PAppContext context) |
To be instantiated by the context.
|
protected |
SimpleTimer2(I2PAppContext context,
java.lang.String name) |
To be instantiated by the context.
|
protected |
SimpleTimer2(I2PAppContext context,
java.lang.String name,
boolean prestartAllThreads) |
To be instantiated by the context.
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
addEvent(SimpleTimer.TimedEvent event,
long timeoutMs) |
Queue up the given event to be fired no sooner than timeoutMs from now.
|
void |
addPeriodicEvent(SimpleTimer.TimedEvent event,
long timeoutMs) |
Schedule periodic event
The TimedEvent must not do its own rescheduling.
|
void |
addPeriodicEvent(SimpleTimer.TimedEvent event,
long delay,
long timeoutMs) |
Schedule periodic event
The TimedEvent must not do its own rescheduling.
|
static SimpleTimer2 |
getInstance() |
If you have a context, use context.simpleTimer2() instead
|
void |
stop() |
Stops the SimpleTimer.
|
java.lang.String |
toString() |
public SimpleTimer2(I2PAppContext context)
protected SimpleTimer2(I2PAppContext context, java.lang.String name)
protected SimpleTimer2(I2PAppContext context, java.lang.String name, boolean prestartAllThreads)
public static SimpleTimer2 getInstance()
public void stop()
public void addEvent(SimpleTimer.TimedEvent event, long timeoutMs)
event
- to be run oncetimeoutMs
- run after this delaypublic void addPeriodicEvent(SimpleTimer.TimedEvent event, long timeoutMs)
timeoutMs
- run subsequent iterations of this event every timeoutMs ms, 5000 minimumjava.lang.IllegalArgumentException
- if timeoutMs less than 5000public void addPeriodicEvent(SimpleTimer.TimedEvent event, long delay, long timeoutMs)
delay
- run the first iteration of this event after delay mstimeoutMs
- run subsequent iterations of this event every timeoutMs ms, 5000 minimumjava.lang.IllegalArgumentException
- if timeoutMs less than 5000public java.lang.String toString()
toString
クラス内 java.lang.Object