de.jadv.server.manager
Class EventManager

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--de.jadv.server.manager.EventManager
All Implemented Interfaces:
java.lang.Runnable

public class EventManager
extends java.lang.Thread

EventManager This implements the main EventManager. It starts and controls the EventThreads.

Author:
neitzel

Field Summary
private  long _oldCounter
           
private  java.util.Timer _Timer
           
 long counter
           
private  EventThread eThread
           
private  EventList eventList
           
 Event LastHandledEvent
           
private  boolean shouldStop
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EventManager()
           
 
Method Summary
 void addEvent(Event evt)
          Add an Event to the Event Queue
 void addHeartBeatTask(JAdvObject obj, long time)
          Add the HeartBeat for an Object.
 void addTimer(JAdvObject obj, long time)
          Add the timer for an Object
 void clearEvent()
          clear the last handled Event This should be done from the EventThread directly after working on the Event.
 Event getEvent()
          Get an Event from the EventQueue
 void run()
          Main function of the EventManager
 void stopThread()
          Stop the main function of the EventManager
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

counter

public long counter

_oldCounter

private long _oldCounter

shouldStop

private boolean shouldStop

LastHandledEvent

public Event LastHandledEvent

eventList

private EventList eventList

_Timer

private java.util.Timer _Timer

eThread

private EventThread eThread
Constructor Detail

EventManager

public EventManager()
Method Detail

addHeartBeatTask

public void addHeartBeatTask(JAdvObject obj,
                             long time)
Add the HeartBeat for an Object.

Parameters:
obj - - Object for HeartBeat
time - - Time in seconds

addTimer

public void addTimer(JAdvObject obj,
                     long time)
Add the timer for an Object

Parameters:
obj - - Object for Timer
time - - Time in seconds

clearEvent

public void clearEvent()
clear the last handled Event This should be done from the EventThread directly after working on the Event.


run

public void run()
Main function of the EventManager

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopThread

public void stopThread()
Stop the main function of the EventManager


addEvent

public void addEvent(Event evt)
Add an Event to the Event Queue

Parameters:
evt -

getEvent

public Event getEvent()
Get an Event from the EventQueue

Returns:
Event