com.espertech.esper.timer
Class TimerServiceImpl

java.lang.Object
  extended by com.espertech.esper.timer.TimerServiceImpl
All Implemented Interfaces:
TimerService

public final class TimerServiceImpl
extends java.lang.Object
implements TimerService

Implementation of the internal clocking service interface.


Constructor Summary
TimerServiceImpl(java.lang.String engineURI, long msecTimerResolution)
          Constructor.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerServiceImpl

public TimerServiceImpl(java.lang.String engineURI,
                        long msecTimerResolution)
Constructor.

Parameters:
msecTimerResolution - is the millisecond resolution or interval the internal timer thread processes schedules
engineURI - engine URI
Method Detail

getMsecTimerResolution

public long getMsecTimerResolution()
Returns the timer resolution.

Returns:
the millisecond resolution or interval the internal timer thread processes schedules

setCallback

public void setCallback(TimerCallback timerCallback)
Description copied from interface: TimerService
Set the callback method to invoke for clock ticks.

Specified by:
setCallback in interface TimerService
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 interface TimerService

stopInternalClock

public final void stopInternalClock(boolean warnIfNotStarted)
Description copied from interface: TimerService
Stop internal clock.

Specified by:
stopInternalClock in interface TimerService
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 interface TimerService

disableStats

public void disableStats()
Description copied from interface: TimerService
Disable statistics.

Specified by:
disableStats in interface TimerService

getMaxDrift

public long getMaxDrift()
Description copied from interface: TimerService
Return maximum drift.

Specified by:
getMaxDrift in interface TimerService
Returns:
drift

getLastDrift

public long getLastDrift()
Description copied from interface: TimerService
Return last drift.

Specified by:
getLastDrift in interface TimerService
Returns:
drift

getTotalDrift

public long getTotalDrift()
Description copied from interface: TimerService
Return total drift.

Specified by:
getTotalDrift in interface TimerService
Returns:
drift

getInvocationCount

public long getInvocationCount()
Description copied from interface: TimerService
Return invocation count.

Specified by:
getInvocationCount in interface TimerService
Returns:
count

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com