Class TimerFactory


  • public class TimerFactory
    extends Object
    Factory that creates a Timer. This implementation of a Timer provides the following features not provided by java.util.Timer 1) Timer thread has a priority and 2) A TimerNode can be reused.
    Author:
    mrk
    • Constructor Detail

      • TimerFactory

        public TimerFactory()
    • Method Detail

      • create

        public static Timer create​(String threadName,
                                   ThreadPriority priority)
        Create and return a Timer.
        Parameters:
        threadName - the thread name for the timer thread
        priority - the priority for the timer thread
        Returns:
        the new timer
      • createNode

        public static Timer.TimerNode createNode​(Timer.TimerCallback timerCallback)
        Create a TimerNode that can be passed to the schedule methods.
        Parameters:
        timerCallback - the callbacks called when the timer expires or is stopped
        Returns:
        the TimerNode created