Class TimerServiceImpl

java.lang.Object
com.espertech.esper.runtime.internal.timer.TimerServiceImpl
All Implemented Interfaces:
TimerService

public final class TimerServiceImpl extends Object implements TimerService
Implementation of the internal clocking service interface.
  • Constructor Details

    • TimerServiceImpl

      public TimerServiceImpl(String runtimeURI, long msecTimerResolution)
      Constructor.
      Parameters:
      msecTimerResolution - is the millisecond resolution or interval the internal timer thread processes schedules
      runtimeURI - 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

      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