| java.lang.Object com.rift.coad.daemon.timer.TimerImpl
TimerImpl | public class TimerImpl implements Timer,BeanRunnable(Code) | | The Timer implementation implements the Timer interface. All the logic
involved in creating, processing, listing and deleting events is within the
methods of this class.
author: Glynn Chaldecott |
Field Summary | |
protected Logger | log |
Method Summary | |
public void | deleteEvent(int eventId) This method deletes an event based on a supplied event ID which
corresponds to the database ID. | public TimerEvent[] | listEvents() This method returns a list of all the events currently stored in the
database.
The method returns a List of TimerEvent objects. | public void | process() This method is the thread. | public void | register(String JNDI, int month, int day, int hour, int minute, Serializable event, boolean recure) This method will register an event on the database.
Parameters: JNDI - This is a string for the JNDI of the daemon that is to be called by the event. Parameters: month - The month of the event. | public void | terminate() This method terminates the thread. |
deleteEvent | public void deleteEvent(int eventId) throws RemoteException, TimerException(Code) | | This method deletes an event based on a supplied event ID which
corresponds to the database ID.
Parameters: eventID - The database ID of the event. |
listEvents | public TimerEvent[] listEvents() throws RemoteException, TimerException(Code) | | This method returns a list of all the events currently stored in the
database.
The method returns a List of TimerEvent objects. The TimerEvent object contains all the properties of an event from the database. |
process | public void process()(Code) | | This method is the thread. It loops once every minute checking the
database for events assigned to that time. It then processes the event
and deletes it from the database should recure be set to false.
|
register | public void register(String JNDI, int month, int day, int hour, int minute, Serializable event, boolean recure) throws RemoteException, TimerException(Code) | | This method will register an event on the database.
Parameters: JNDI - This is a string for the JNDI of the daemon that is to be called by the event. Parameters: month - The month of the event. -1 will occur monthly. (Thisparameter is zero indexed) Parameters: day - The day of the event. -1 will occur daily. Parameters: hour - The hour of the event. -1 will occur hourly. Parameters: minute - The minute of the event. -1 will occur every minute. Parameters: event - This is a serializable object used to identify an individualevent. Parameters: recure - The value of this indicates whether an event will occur more then once of be deleted from the database after a single occurence. True will cause it to recure, false will result in itbeing deleted after a single occurence |
terminate | public void terminate()(Code) | | This method terminates the thread.
|
|
|