public final class TimerServiceImpl extends Object implements TimerService
Constructor and Description |
---|
TimerServiceImpl(String runtimeURI,
long msecTimerResolution)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
disableStats()
Disable statistics.
|
void |
enableStats()
Enable statistics.
|
long |
getInvocationCount()
Return invocation count.
|
long |
getLastDrift()
Return last drift.
|
long |
getMaxDrift()
Return maximum drift.
|
long |
getMsecTimerResolution()
Returns the timer resolution.
|
long |
getTotalDrift()
Return total drift.
|
void |
setCallback(TimerCallback timerCallback)
Set the callback method to invoke for clock ticks.
|
void |
startInternalClock()
Start clock expecting callbacks at regular intervals and a fixed rate.
|
void |
stopInternalClock(boolean warnIfNotStarted)
Stop internal clock.
|
public TimerServiceImpl(String runtimeURI, long msecTimerResolution)
msecTimerResolution
- is the millisecond resolution or interval the internal timer thread
processes schedulesruntimeURI
- runtime URIpublic long getMsecTimerResolution()
public void setCallback(TimerCallback timerCallback)
TimerService
setCallback
in interface TimerService
timerCallback
- is the callbackpublic final void startInternalClock()
TimerService
startInternalClock
in interface TimerService
public final void stopInternalClock(boolean warnIfNotStarted)
TimerService
stopInternalClock
in interface TimerService
warnIfNotStarted
- use true to indicate whether to warn if the clock is not started, use false to not warn
and expect the clock to be not started.public void enableStats()
TimerService
enableStats
in interface TimerService
public void disableStats()
TimerService
disableStats
in interface TimerService
public long getMaxDrift()
TimerService
getMaxDrift
in interface TimerService
public long getLastDrift()
TimerService
getLastDrift
in interface TimerService
public long getTotalDrift()
TimerService
getTotalDrift
in interface TimerService
public long getInvocationCount()
TimerService
getInvocationCount
in interface TimerService
Copyright © 2005–2018. All rights reserved.