Class TimerServiceImpl
java.lang.Object
com.espertech.esper.runtime.internal.timer.TimerServiceImpl
- All Implemented Interfaces:
TimerService
Implementation of the internal clocking service interface.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Disable statistics.void
Enable statistics.long
Return invocation count.long
Return last drift.long
Return maximum drift.long
Returns the timer resolution.long
Return total drift.void
setCallback
(TimerCallback timerCallback) Set the callback method to invoke for clock ticks.final void
Start clock expecting callbacks at regular intervals and a fixed rate.final void
stopInternalClock
(boolean warnIfNotStarted) Stop internal clock.
-
Constructor Details
-
TimerServiceImpl
Constructor.- Parameters:
msecTimerResolution
- is the millisecond resolution or interval the internal timer thread processes schedulesruntimeURI
- runtime URI
-
-
Method Details
-
getMsecTimerResolution
public long getMsecTimerResolution()Returns the timer resolution.- Returns:
- the millisecond resolution or interval the internal timer thread processes schedules
-
setCallback
Description copied from interface:TimerService
Set the callback method to invoke for clock ticks.- Specified by:
setCallback
in interfaceTimerService
- Parameters:
timerCallback
- is the callback
-
startInternalClock
public final void startInternalClock()Description copied from interface:TimerService
Start clock expecting callbacks at regular intervals and a fixed rate. Catch-up callbacks are possible should the callback fall behind.- Specified by:
startInternalClock
in interfaceTimerService
-
stopInternalClock
public final void stopInternalClock(boolean warnIfNotStarted) Description copied from interface:TimerService
Stop internal clock.- Specified by:
stopInternalClock
in interfaceTimerService
- Parameters:
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.
-
enableStats
public void enableStats()Description copied from interface:TimerService
Enable statistics.- Specified by:
enableStats
in interfaceTimerService
-
disableStats
public void disableStats()Description copied from interface:TimerService
Disable statistics.- Specified by:
disableStats
in interfaceTimerService
-
getMaxDrift
public long getMaxDrift()Description copied from interface:TimerService
Return maximum drift.- Specified by:
getMaxDrift
in interfaceTimerService
- Returns:
- drift
-
getLastDrift
public long getLastDrift()Description copied from interface:TimerService
Return last drift.- Specified by:
getLastDrift
in interfaceTimerService
- Returns:
- drift
-
getTotalDrift
public long getTotalDrift()Description copied from interface:TimerService
Return total drift.- Specified by:
getTotalDrift
in interfaceTimerService
- Returns:
- drift
-
getInvocationCount
public long getInvocationCount()Description copied from interface:TimerService
Return invocation count.- Specified by:
getInvocationCount
in interfaceTimerService
- Returns:
- count
-