Package com.hybris.cockpitng.core.events
Interface CockpitEventQueue
-
- All Known Implementing Classes:
DefaultCockpitEventQueue
public interface CockpitEventQueueThe cockpit event queue gives the ability to process system events and convert them to cockpit socket events. They can be connected to normal widgets using EventAcceptorWidgets. It is also possible to publish events from a widget using the EventProducerWidget.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<CockpitEvent>fetchEvents(java.lang.String widgetID)Returns all events available for the specified widget and removes them from the queue.voidpublishEvent(CockpitEvent event)Adds an event to the event queue.voidregisterListener(java.lang.String widgetID, java.lang.String eventName, java.lang.String scope)Registers the widget as a listener for the specified event.voidremoveListener(java.lang.String widgetID)Remove the specified widget from the set of listeners.
-
-
-
Method Detail
-
publishEvent
void publishEvent(CockpitEvent event)
Adds an event to the event queue.- Parameters:
event- The event to publish.
-
registerListener
void registerListener(java.lang.String widgetID, java.lang.String eventName, java.lang.String scope)Registers the widget as a listener for the specified event.- Parameters:
widgetID- A string that represents the widget.eventName- A string that defines the event.
-
removeListener
void removeListener(java.lang.String widgetID)
Remove the specified widget from the set of listeners. If the widget is not registered, this method does nothing.- Parameters:
widgetID- The widget to remove from the listeners.
-
fetchEvents
java.util.List<CockpitEvent> fetchEvents(java.lang.String widgetID)
Returns all events available for the specified widget and removes them from the queue.- Parameters:
widgetID- The widget for which the events should be fetched.- Returns:
- The events being published since the last call of this method or an empty list, if the widget has not been registered.
-
-