public interface EventDispatcher
Modifier and Type | Method and Description |
---|---|
void |
addHandler(EventHandler eventHandler)
Adds event handler to the dispatcher.
|
void |
clear()
Clears all handles associated with this dispatcher.
|
void |
close()
Called by the session during disconnect, the dispatcher will no longer
accept any events, it will also detach the existing listeners.
|
void |
fireEvent(Event event)
Fires event in asynchronous mode
|
List<EventHandler> |
getHandlers(int eventType)
Returns the list of
EventHandler s associated with a particular
event type. |
void |
removeHandler(EventHandler eventHandler)
Removes an event handler from the dispatcher
|
void |
removeHandlersForEvent(int eventType)
Removes all event listeners associated with the event type.
|
boolean |
removeHandlersForSession(Session session)
Removes all the handlers for a session.
|
void addHandler(EventHandler eventHandler)
eventHandler
- The event handler to be added to the dispatcher.List<EventHandler> getHandlers(int eventType)
EventHandler
s associated with a particular
event type.eventType
- The type of event.EventHandler
s associated with that event or
null.void removeHandler(EventHandler eventHandler)
eventHandler
- the event handler to be removed from the dispatchervoid removeHandlersForEvent(int eventType)
boolean removeHandlersForSession(Session session)
session
- The session instance from which event handlers need to be
removed.void clear()
void fireEvent(Event event)
void close()
Copyright © 2013. All Rights Reserved.