public interface HGEventManager extends HGGraphHolder
HGEventManager is bound to a single HyperGraph instance. It is responsible for holding
all event listeners and it performs event handling via its
dispatch method. Concrete
implementations can be configured with the
HGConfiguration object when the database is
Event types are simply identified by their Java class objects.
|Modifier and Type||Method and Description|
Register a new listener for a given event type.
Removal all event listeners for all event types.
Dispatch an event to all listeners registered for its type.
Remove a listener registered for the particular type.
<T extends HGEvent> void addListener(Class<T> eventType, HGListener listener)
<T extends HGEvent> void removeListener(Class<T> eventType, HGListener listener)
HGListener.Result dispatch(HyperGraph graph, HGEvent event)
Dispatch an event to all listeners registered for its type. All listeners
are invoked in the order in which they were registered. If a listener returns
HGListener.Result.cancel event, the dispatch process is interrupted and
the cancellation is passed on to the caller of the dispatch method without invoking
any further listeners.
Because event types can be organized in hierarchy, rooted at
HGEvent, a dispatcher
must call listener registered for the particular event class and also all its superclasses up
HGEvent type itself.
Copyright © 2015. All rights reserved.