Interface IEvent
- All Superinterfaces:
INotifiable
- All Known Implementing Classes:
Event
An interface for Events, which are part of the Command design pattern. Events
allows to send asynchronous notifications to multiple subscribed listeners.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(IEventListener listener) Adds a listener to receive notifications for this event.Gets all subscribed listeners.getName()
Gets the event name.void
removeListener
(IEventListener listener) Removes a listener, so that it no longer receives notifications for this event.Methods inherited from interface org.pipservices3.commons.run.INotifiable
notify
-
Method Details
-
getName
String getName()Gets the event name.- Returns:
- the name of the event.
-
getListeners
List<IEventListener> getListeners()Gets all subscribed listeners.- Returns:
- a list of listeners.
-
addListener
Adds a listener to receive notifications for this event.- Parameters:
listener
- the listener reference to add.
-
removeListener
Removes a listener, so that it no longer receives notifications for this event.- Parameters:
listener
- the listener reference to remove.
-