|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
src.server.EventHandler
Class to handle server triggered events. Modules can register events with the event handler which will then be triggered with the specified periodicity.
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
EventHandler(int minimumInterval)
Constructor for EventHandler. |
|
| Method Summary | |
boolean |
deregisterEvent(EventReceiver receiver,
java.lang.String eventId)
Deregisters an event. |
static EventHandler |
getInstance()
Get instance of this singleton class. |
boolean |
registerEvent(EventReceiver receiver,
java.lang.String eventId,
java.util.Date runStart,
int interval)
Register an event. |
void |
run()
Thread runner method. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public EventHandler(int minimumInterval)
minimumInterval - The handler's update resolution. Intervals lower
than this will not work as intended.| Method Detail |
public static EventHandler getInstance()
public boolean registerEvent(EventReceiver receiver,
java.lang.String eventId,
java.util.Date runStart,
int interval)
receiver - The receiver to which the event should be sent when it's triggered.eventId - A piece of data which will be sent to the module when this event
is registered.runStart - The next time this event should be run (ie. the starting time).interval - The interval in minutes for which to run this event, may be 0
to indicate one time event.
public boolean deregisterEvent(EventReceiver receiver,
java.lang.String eventId)
receiver - The receiver for which this event has been registered.eventId - The id of the event (as was specified in the registerEvent).
public void run()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||