Class ShutdownableHashedWheelTimer

java.lang.Object
io.netty.util.HashedWheelTimer
com.linkedin.alpini.netty4.misc.ShutdownableHashedWheelTimer
All Implemented Interfaces:
Shutdownable, io.netty.util.Timer

public class ShutdownableHashedWheelTimer extends io.netty.util.HashedWheelTimer implements Shutdownable
  • Constructor Details

    • ShutdownableHashedWheelTimer

      public ShutdownableHashedWheelTimer()
      Creates a new timer with the default thread factory (Executors.defaultThreadFactory()), default tick duration, and default number of ticks per wheel.
    • ShutdownableHashedWheelTimer

      public ShutdownableHashedWheelTimer(long tickDuration, TimeUnit unit)
      Creates a new timer with the default thread factory (Executors.defaultThreadFactory()) and default number of ticks per wheel.
      Parameters:
      tickDuration - the duration between tick
      unit - the time unit of the tickDuration
      Throws:
      NullPointerException - if unit is null
      IllegalArgumentException - if tickDuration is <= 0
    • ShutdownableHashedWheelTimer

      public ShutdownableHashedWheelTimer(long tickDuration, TimeUnit unit, int ticksPerWheel)
      Creates a new timer with the default thread factory (Executors.defaultThreadFactory()).
      Parameters:
      tickDuration - the duration between tick
      unit - the time unit of the tickDuration
      ticksPerWheel - the size of the wheel
      Throws:
      NullPointerException - if unit is null
      IllegalArgumentException - if either of tickDuration and ticksPerWheel is <= 0
    • ShutdownableHashedWheelTimer

      public ShutdownableHashedWheelTimer(ThreadFactory threadFactory)
      Creates a new timer with the default tick duration and default number of ticks per wheel.
      Parameters:
      threadFactory - a ThreadFactory that creates a background Thread which is dedicated to TimerTask execution.
      Throws:
      NullPointerException - if threadFactory is null
    • ShutdownableHashedWheelTimer

      public ShutdownableHashedWheelTimer(ThreadFactory threadFactory, long tickDuration, TimeUnit unit)
      Creates a new timer with the default number of ticks per wheel.
      Parameters:
      threadFactory - a ThreadFactory that creates a background Thread which is dedicated to TimerTask execution.
      tickDuration - the duration between tick
      unit - the time unit of the tickDuration
      Throws:
      NullPointerException - if either of threadFactory and unit is null
      IllegalArgumentException - if tickDuration is <= 0
    • ShutdownableHashedWheelTimer

      public ShutdownableHashedWheelTimer(ThreadFactory threadFactory, long tickDuration, TimeUnit unit, int ticksPerWheel)
      Creates a new timer.
      Parameters:
      threadFactory - a ThreadFactory that creates a background Thread which is dedicated to TimerTask execution.
      tickDuration - the duration between tick
      unit - the time unit of the tickDuration
      ticksPerWheel - the size of the wheel
      Throws:
      NullPointerException - if either of threadFactory and unit is null
      IllegalArgumentException - if either of tickDuration and ticksPerWheel is <= 0
    • ShutdownableHashedWheelTimer

      public ShutdownableHashedWheelTimer(ThreadFactory threadFactory, long tickDuration, TimeUnit unit, int ticksPerWheel, boolean leakDetection)
      Creates a new timer.
      Parameters:
      threadFactory - a ThreadFactory that creates a background Thread which is dedicated to TimerTask execution.
      tickDuration - the duration between tick
      unit - the time unit of the tickDuration
      ticksPerWheel - the size of the wheel
      leakDetection - true if leak detection should be enabled always, if false it will only be enabled if the worker thread is not a daemon thread.
      Throws:
      NullPointerException - if either of threadFactory and unit is null
      IllegalArgumentException - if either of tickDuration and ticksPerWheel is <= 0
  • Method Details