org.omnaest.utils.events
Interface EventManager<EVENT,RESULT>

Type Parameters:
EVENT -
RESULT -
All Superinterfaces:
EventProducer<EVENT,RESULT>, Serializable
All Known Implementing Classes:
EventManagerImpl

public interface EventManager<EVENT,RESULT>
extends EventProducer<EVENT,RESULT>

The EventManager is the central control unit within a client class which want to fire events. It holds references to an EventListenerRegistration as well as to a EventManagerConnector.

The fireEvent(Object) method will pick up given events and will take care of the event handling. This includes the management of connected EventListener as well as a chaining path via the EventManagerConnector.

Additionally with the EventProducer interface clients can make themselves usable for EventHandler instances which delegates the control to a central EventHandler.

Author:
Omnaest

Method Summary
 EventManager<EVENT,RESULT> clearListeners()
          Removes all listeners from the EventManager instance.
 EventResults<RESULT> fireEvent(EVENT event)
          Fires a given event.
 EventManagerConnector<EVENT,RESULT> getEventManagerConnector()
           
 
Methods inherited from interface org.omnaest.utils.events.EventProducer
getEventListenerRegistration
 

Method Detail

clearListeners

EventManager<EVENT,RESULT> clearListeners()
Removes all listeners from the EventManager instance.

Returns:
this

fireEvent

EventResults<RESULT> fireEvent(EVENT event)
Fires a given event. This will move the current control flow to the registered EventListener instances. This implies that performance critical logic should fire events carefully, since it can not be guaranteed that connected EventListener will handle the event with acceptable performance.

Parameters:
event -
Returns:
EventResults

getEventManagerConnector

EventManagerConnector<EVENT,RESULT> getEventManagerConnector()
Returns:
See Also:
EventManagerConnector


Copyright © 2013. All Rights Reserved.