Class TimerManager

java.lang.Object
com.groiss.timer.TimerManager
All Implemented Interfaces:
Lifecycle, Service

public class TimerManager extends Object implements Service
The timer manager is the service controlling the timer executions.
  • Constructor Details

    • TimerManager

      public TimerManager()
  • Method Details

    • startup

      public void startup()
      Description copied from interface: Lifecycle
      This method is called when the object is "started".
      Specified by:
      startup in interface Lifecycle
    • shutdown

      public void shutdown()
      Description copied from interface: Lifecycle
      This method is called on shutdown.
      Specified by:
      shutdown in interface Lifecycle
    • isRunning

      public boolean isRunning()
      Description copied from interface: Service
      Ask the object if it has been started
      Specified by:
      isRunning in interface Service
      Returns:
      true if running.
    • reconfigure

      public void reconfigure()
      Reschedule the timers after some properties of a timer has been changed.
      Specified by:
      reconfigure in interface Service
    • showQueue

      public void showQueue(HttpServletRequest req, HttpServletResponse res) throws Exception
      Shows an overview of the timer subsystem. Useful for debugging.
      Parameters:
      req - is ignored
      Throws:
      Exception
    • resetExceptions

      public static void resetExceptions(TimerEntry tEntry)
      Empty the list of sent exceptions.
    • timerException

      public static void timerException(TimerEntry timerEntry, Persistent so, String message, Throwable e)
      This method is for exception handling in a timer task. It performs two actions: (1) a mail is sent to the administrator, (2) the exception is stored in a list for preventing sending the same mail again.
      Parameters:
      timerEntry - the timer entry.
      so - a context object
      message - the error message
      e - the exception you want to report.