LiveGraph
data visualisation and analysis framework

org.LiveGraph.events
Class EventManager

java.lang.Object
  extended by org.LiveGraph.events.EventManager
All Implemented Interfaces:
EventProducer

public class EventManager
extends java.lang.Object
implements EventProducer


Nested Class Summary
private  class EventManager.EventDispatcher
           
static interface EventManager.ShutDownHook
           
 
Field Summary
private  java.lang.Thread eventDispatcher
           
private  java.util.Queue<Event<? extends EventType>> eventQueue
           
private  java.util.List<EventListener> listeners
           
private  java.util.List<EventManager.ShutDownHook> shutDownHooks
           
private  boolean shutDownImmediately
           
private  boolean shutDownWhenFinished
           
 
Constructor Summary
EventManager()
           
 
Method Summary
 boolean addShutDownHook(EventManager.ShutDownHook hook)
           
 int countAllListeners()
           
private  void debug_printQueue()
           
private  void doRaiseEvent(Event<? extends EventType> event)
           
 boolean eventProcessingException(Event<? extends EventType> event, EventProcessingException exception)
           
 void eventProcessingFinished(Event<? extends EventType> event)
           
 boolean eventValidateRaise(Event<? extends EventType> event)
           
 java.util.List<EventListener> getInterestedListeners(Event<? extends EventType> event)
           
private  void hasShutDown()
           
private  void justDisplayException(java.lang.Throwable ex)
           
 boolean managesListener(EventListener listener)
           
private  boolean mustShutDown()
           
 void raiseEvent(Event<? extends EventType> event)
           
private  void raiseExceptionOccured(Event<? extends EventType> event, EventProcessingException exception)
           
 boolean registerListener(EventListener listener)
           
 void shutDownImmediately()
           
 void shutDownWhenFinished()
           
 void startDispatchingEvents()
           
 boolean unregisterListener(EventListener listener)
           
 boolean validateEvent(Event<? extends EventType> event)
           
 void waitForEvents()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private java.util.List<EventListener> listeners

eventQueue

private java.util.Queue<Event<? extends EventType>> eventQueue

shutDownWhenFinished

private boolean shutDownWhenFinished

shutDownImmediately

private boolean shutDownImmediately

eventDispatcher

private java.lang.Thread eventDispatcher

shutDownHooks

private java.util.List<EventManager.ShutDownHook> shutDownHooks
Constructor Detail

EventManager

public EventManager()
Method Detail

addShutDownHook

public boolean addShutDownHook(EventManager.ShutDownHook hook)

startDispatchingEvents

public void startDispatchingEvents()

shutDownWhenFinished

public void shutDownWhenFinished()

shutDownImmediately

public void shutDownImmediately()

debug_printQueue

private void debug_printQueue()

waitForEvents

public void waitForEvents()

mustShutDown

private boolean mustShutDown()

hasShutDown

private void hasShutDown()

registerListener

public boolean registerListener(EventListener listener)

managesListener

public boolean managesListener(EventListener listener)

unregisterListener

public boolean unregisterListener(EventListener listener)

countAllListeners

public int countAllListeners()

getInterestedListeners

public java.util.List<EventListener> getInterestedListeners(Event<? extends EventType> event)
                                                     throws EventProcessingException
Throws:
EventProcessingException

validateEvent

public boolean validateEvent(Event<? extends EventType> event)
                      throws EventProcessingException,
                             ValidationRequirementException
Throws:
EventProcessingException
ValidationRequirementException

raiseEvent

public void raiseEvent(Event<? extends EventType> event)
                throws ValidationRequirementException
Throws:
ValidationRequirementException

eventValidateRaise

public boolean eventValidateRaise(Event<? extends EventType> event)
                           throws EventProcessingException
Throws:
EventProcessingException

doRaiseEvent

private void doRaiseEvent(Event<? extends EventType> event)
                   throws EventProcessingException
Throws:
EventProcessingException

raiseExceptionOccured

private void raiseExceptionOccured(Event<? extends EventType> event,
                                   EventProcessingException exception)

justDisplayException

private void justDisplayException(java.lang.Throwable ex)

eventProcessingFinished

public void eventProcessingFinished(Event<? extends EventType> event)
Specified by:
eventProcessingFinished in interface EventProducer

eventProcessingException

public boolean eventProcessingException(Event<? extends EventType> event,
                                        EventProcessingException exception)
Specified by:
eventProcessingException in interface EventProducer

LiveGraph
data visualisation and analysis framework