com.groiss.timer
Class TimerManager

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

public class TimerManager
extends java.lang.Object
implements Service

The timer manager is the service controlling the timer executions.


Constructor Summary
TimerManager()
           
 
Method Summary
 boolean isRunning()
          Ask the object if it has been started
 void reconfigure()
          Reschedule the timers after some properties of a timer has been changed.
static void resetExceptions(com.groiss.timer.impl.TimerEntry tEntry)
          Empty the list of sent exceptions.
 void showQueue(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Shows a list of the timers that are scheduled.
 void shutdown()
          This method is called on shutdown.
 void startup()
          This method is called when the object is "started".
static void timerException(TimerEntry tEntry, Persistent so, java.lang.String message, java.lang.Throwable e)
          This method is for exception handling in a timer task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerManager

public TimerManager()
Method Detail

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(javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse res)
               throws java.lang.Exception
Shows a list of the timers that are scheduled. The method is used for debugging.

Throws:
java.lang.Exception

resetExceptions

public static void resetExceptions(com.groiss.timer.impl.TimerEntry tEntry)
Empty the list of sent exceptions.


timerException

public static void timerException(TimerEntry tEntry,
                                  Persistent so,
                                  java.lang.String message,
                                  java.lang.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:
tEntry - the timer entry.
so - a context object
message - the error message
e - the excpetion you want to report.


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.