Class HierarchicalWheelTimer

  • All Implemented Interfaces:
    Timer

    public class HierarchicalWheelTimer
    extends java.lang.Object
    implements Timer
    HierarchicalWheelTimer The type Hierarchical Wheel timer.
    See Also:
    TimingWheel
    • Constructor Summary

      Constructors 
      Constructor Description
      HierarchicalWheelTimer​(java.lang.String executorName)
      Instantiates a new System timer.
      HierarchicalWheelTimer​(java.lang.String executorName, java.lang.Long tickMs, java.lang.Integer wheelSize, java.lang.Long startMs)
      Instantiates a new System timer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(TimerTask timerTask)
      Add timer task.
      void advanceClock​(long timeoutMs)
      Advance clock boolean.
      void shutdown()
      Shutdown.
      int size()
      Size int.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HierarchicalWheelTimer

        public HierarchicalWheelTimer​(java.lang.String executorName)
        Instantiates a new System timer.
        Parameters:
        executorName - the executor name
      • HierarchicalWheelTimer

        public HierarchicalWheelTimer​(java.lang.String executorName,
                                      java.lang.Long tickMs,
                                      java.lang.Integer wheelSize,
                                      java.lang.Long startMs)
        Instantiates a new System timer.
        Parameters:
        executorName - the executor name
        tickMs - the tick ms
        wheelSize - the wheel size
        startMs - the start ms
    • Method Detail

      • add

        public void add​(TimerTask timerTask)
        Description copied from interface: Timer
        Add timer task.
        Specified by:
        add in interface Timer
        Parameters:
        timerTask - the timer task
      • advanceClock

        public void advanceClock​(long timeoutMs)
                          throws java.lang.InterruptedException
        Description copied from interface: Timer
        Advance clock boolean.
        Specified by:
        advanceClock in interface Timer
        Parameters:
        timeoutMs - the timeout ms
        Throws:
        java.lang.InterruptedException - the interrupted exception
      • size

        public int size()
        Description copied from interface: Timer
        Size int.
        Specified by:
        size in interface Timer
        Returns:
        the int
      • shutdown

        public void shutdown()
        Description copied from interface: Timer
        Shutdown.
        Specified by:
        shutdown in interface Timer