Class IntervalTimer

java.lang.Object
com.swiftmq.impl.streams.comp.timer.IntervalTimer
All Implemented Interfaces:
Timer

public class IntervalTimer extends Object implements Timer
Interval Timer implementation. Executes the onTimer callback in an interval.
Author:
IIT Software GmbH, Muenster/Germany, (c) 2016, All Rights Reserved
  • Method Details

    • days

      public IntervalTimer days(int n)
      Adds n days to the interval.
      Parameters:
      n - days
      Returns:
      IntervalTimer
    • hours

      public IntervalTimer hours(int n)
      Adds n hours to the interval.
      Parameters:
      n - hours
      Returns:
      IntervalTimer
    • minutes

      public IntervalTimer minutes(int n)
      Adds n minutes to the interval.
      Parameters:
      n - minutes
      Returns:
      IntervalTimer
    • seconds

      public IntervalTimer seconds(int n)
      Adds n seconds to the interval.
      Parameters:
      n - seconds
      Returns:
      IntervalTimer
    • milliseconds

      public IntervalTimer milliseconds(long n)
      Adds n days to the milliseconds.
      Parameters:
      n - milliseconds
      Returns:
      IntervalTimer
    • executeCallback

      public void executeCallback() throws Exception
      Description copied from interface: Timer
      Internal use.
      Specified by:
      executeCallback in interface Timer
      Throws:
      Exception
    • setTimerListener

      public void setTimerListener(TimerListener listener)
      Description copied from interface: Timer
      Internal use.
      Specified by:
      setTimerListener in interface Timer
    • getTimerListener

      public TimerListener getTimerListener()
      Description copied from interface: Timer
      Internal use.
      Specified by:
      getTimerListener in interface Timer
    • name

      public String name()
      Description copied from interface: Timer
      Returns the name of the Timer.
      Specified by:
      name in interface Timer
      Returns:
      Name
    • onTimer

      public Timer onTimer(TimerCallback callback)
      Description copied from interface: Timer
      Sets the onTimer callback.
      Specified by:
      onTimer in interface Timer
      Parameters:
      callback - callback
      Returns:
      Timer
    • collect

      public void collect(long interval)
      Description copied from interface: Timer
      Internal use
      Specified by:
      collect in interface Timer
    • start

      public void start() throws Exception
      Description copied from interface: Timer
      Starts this Timer. This method is called automatically if a Timer is created outside a callback. If it is created inside, it must be called explicitly.
      Specified by:
      start in interface Timer
      Throws:
      Exception
    • reset

      public Timer reset()
      Description copied from interface: Timer
      Resets the value of a Timer
      Specified by:
      reset in interface Timer
    • reconfigure

      public void reconfigure() throws Exception
      Description copied from interface: Timer
      Reconfigures this Timer and applies new settings
      Specified by:
      reconfigure in interface Timer
      Throws:
      Exception
    • close

      public void close()
      Description copied from interface: Timer
      Closes this Timer.
      Specified by:
      close in interface Timer
    • toString

      public String toString()
      Overrides:
      toString in class Object