Package com.kheops.jmap.server
Class JMapServerDataEventsManager
java.lang.Object
com.kheops.jmap.server.JMapServerDataEventsManager
Centralized point to control jmap server events system. Accepts listeners to
be registered for concrete types of events and notifies them once events are
fired.
Asynchronous events queue manipulation is based in com.kheops.jmap.client.JMapEventQueue
Asynchronous events queue manipulation is based in com.kheops.jmap.client.JMapEventQueue
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(JMapServerDataEventListener listener) void
destroy()
Destroys the singleton instance, invalidating all queued events.void
fireEvent
(JMapServerDataEvent event) To publish an event notifying all subscribed listeners for the concrete event type.static JMapServerDataEventsManager
Returns the JMap event queue instance.boolean
Returns the verbose property of the event queue.void
<EventObject extends JMapServerDataEvent>
voidremoveListener
(JMapServerDataEventListener<EventObject> listener) void
setVerbose
(boolean verbose) Sets the verbose property of the event queue.
-
Method Details
-
getInstance
Returns the JMap event queue instance. If the instance doesn't currently exist, a new instance is created.- Returns:
- the JMap event queue instance.
-
addListener
-
removeListener
public <EventObject extends JMapServerDataEvent> void removeListener(JMapServerDataEventListener<EventObject> listener) -
notifyListeners
-
destroy
public void destroy()Destroys the singleton instance, invalidating all queued events. -
setVerbose
public void setVerbose(boolean verbose) Sets the verbose property of the event queue. If true, all events will be dumped to the standard output.- Parameters:
verbose
- the boolean value to set.
-
isVerbose
public boolean isVerbose()Returns the verbose property of the event queue. When true, all events will be dumped to the standard output. -
fireEvent
To publish an event notifying all subscribed listeners for the concrete event type.
-