de.jadv.server.manager
Class EventThread

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

public class EventThread
extends java.lang.Thread

The EvenThread handles the Events. Normaly there is only one EventThread running at a time!
The EventManager checks, if the Thread is still working correctly. The setCounter() increases a counter in the EventManager, so that the EventManager knows, that the EventThread is still working.
If Configuration.SAVE_ALL_AFTER_EVENT is set to true, the EventThread also calls ObjectManager.saveChanged() is called after each handled event.
This thread is also responsible to get all incoming Events from the Player and put the ClientEvents into the main EventQueue.

Author:
neitzel

Field Summary
private  EventManager _mgr
           
private  long _time
           
private  boolean handledEvent
           
private  boolean shouldstop
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EventThread(EventManager mgr)
           
 
Method Summary
private  void checkPlayerEvents()
          Check for incoming Events and put them all inside the EventQueue
private  void doEvent()
           
 void run()
           
 void setCounter()
          setCounter() This function increases the counter of the EventManager
 void stopThread()
          stop this thred The thread isn't stopped immediately, but a simple flag is set.
 
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

shouldstop

private boolean shouldstop

_mgr

private EventManager _mgr

_time

private long _time

handledEvent

private boolean handledEvent
Constructor Detail

EventThread

public EventThread(EventManager mgr)
Method Detail

checkPlayerEvents

private void checkPlayerEvents()
Check for incoming Events and put them all inside the EventQueue


doEvent

private void doEvent()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

setCounter

public void setCounter()
setCounter() This function increases the counter of the EventManager


stopThread

public void stopThread()
stop this thred The thread isn't stopped immediately, but a simple flag is set.