Package com.groiss.timer
Class TimerManager
java.lang.Object
com.groiss.timer.TimerManager
The timer manager is the service controlling the timer executions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Ask the object if it has been startedvoid
Reschedule the timers after some properties of a timer has been changed.static void
resetExceptions
(TimerEntry tEntry) Empty the list of sent exceptions.void
showQueue
(HttpServletRequest req, HttpServletResponse res) Shows an overview of the timer subsystem.void
shutdown()
This method is called on shutdown.void
startup()
This method is called when the object is "started".static void
timerException
(TimerEntry timerEntry, Persistent so, String message, Throwable e) This method is for exception handling in a timer task.
-
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". -
shutdown
public void shutdown()Description copied from interface:Lifecycle
This method is called on shutdown. -
isRunning
public boolean isRunning()Description copied from interface:Service
Ask the object if it has been started -
reconfigure
public void reconfigure()Reschedule the timers after some properties of a timer has been changed.- Specified by:
reconfigure
in interfaceService
-
showQueue
Shows an overview of the timer subsystem. Useful for debugging.- Parameters:
req
- is ignored- Throws:
Exception
-
resetExceptions
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 objectmessage
- the error messagee
- the exception you want to report.
-