Describer.DefaultPrinter, Describer.Printer| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
LOG |
| 构造器和说明 |
|---|
RepeatedTimer(String name,
int timeoutMs) |
RepeatedTimer(String name,
int timeoutMs,
Timer timer) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected int |
adjustTimeout(int timeoutMs)
Adjust timeoutMs before every scheduling.
|
void |
describe(Describer.Printer out) |
void |
destroy()
Destroy timer
|
int |
getTimeoutMs() |
protected void |
onDestroy()
Called after destroy timer.
|
protected abstract void |
onTrigger()
Subclasses should implement this method for timer trigger.
|
void |
reset()
Reset timer with current timeoutMs
|
void |
reset(int timeoutMs)
Reset timer with new timeoutMs.
|
void |
restart()
Restart the timer.
|
void |
run() |
void |
runOnceNow()
Run the timer at once, it will cancel the timer and re-schedule it.
|
void |
start()
Start the timer.
|
void |
stop()
Stop timer
|
String |
toString() |
public RepeatedTimer(String name, int timeoutMs)
public int getTimeoutMs()
protected abstract void onTrigger()
protected int adjustTimeout(int timeoutMs)
timeoutMs - timeout millispublic void run()
public void runOnceNow()
protected void onDestroy()
public void start()
public void restart()
public void reset(int timeoutMs)
timeoutMs - timeout millispublic void reset()
public void destroy()
public void stop()
public void describe(Describer.Printer out)
Copyright © 2021. All rights reserved.