Module org.refcodes.observer
Package org.refcodes.observer
Interface Publisher<E extends GenericEvent<?>>
- Type Parameters:
E- the element type
public interface Publisher<E extends GenericEvent<?>>
A system publishing
GenericActionEvent instances (such as an event
bus), may implement this interface. An observable (event listener), in case
of being of type Observer, may be notified using the
Observer.onEvent(GenericEvent) method.-
Method Summary
Modifier and TypeMethodDescriptionvoidpublishEvent(E aEvent) The listener implementing this interface is notified of an event via this method.
-
Method Details
-
publishEvent
The listener implementing this interface is notified of an event via this method. The publisher pushes the event to the subscriber. When this method exits, then all listeners have been notified with the given event. I.e. even if each event is dispatched in an own thread, then the longest running thread determines when this method finishes.- Parameters:
aEvent- aEvent The event to be pushed from the publisher to the subscriber.
-