|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EventBus
Specification of the mechanism on which the Event Listeners can subscribe for events and event publishers can publish their events. The event bus dispatches events to all subscribed listeners.
Implementations may or may not dispatch the events to event listeners in the dispatching thread.
EventListener
,
SimpleEventBus
,
ClusteringEventBus
Method Summary | |
---|---|
void |
publish(EventMessage... events)
Publish a collection of events on this bus (one, or multiple). |
void |
subscribe(EventListener eventListener)
Subscribe the given eventListener to this bus. |
void |
unsubscribe(EventListener eventListener)
Unsubscribe the given eventListener to this bus. |
Method Detail |
---|
void publish(EventMessage... events)
events
as a single batch and distribute the events as such to
all subscribed EventListeners.
events
- The collection of events to publishvoid subscribe(EventListener eventListener)
eventListener
to this bus. When subscribed, it will receive all events
published to this bus.
If the given eventListener
is already subscribed, nothing happens.
eventListener
- The event listener to subscribe
EventListenerSubscriptionFailedException
- if the listener could not be subscribedvoid unsubscribe(EventListener eventListener)
eventListener
to this bus. When unsubscribed, it will no longer receive
events
published to this bus.
eventListener
- The event listener to unsubscribe
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |