|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.eventhandling.ClusteringEventBus
public class ClusteringEventBus
EventBus
implementation that supports clustering of Event Listeners. Clusters are connected using EventBus Terminals
, which may either distribute Events locally, or remotely.
Constructor Summary | |
---|---|
ClusteringEventBus()
Initializes a ClusteringEventBus with a SimpleEventBusTerminal and a DefaultClusterSelector . |
|
ClusteringEventBus(ClusterSelector clusterSelector)
Initializes a ClusteringEventBus with the given clusterSelector and a SimpleEventBusTerminal , which dispatches all events to all local clusters synchronously. |
|
ClusteringEventBus(ClusterSelector clusterSelector,
EventBusTerminal terminal)
Initializes a ClusteringEventBus with the given clusterSelector and a
terminal . |
|
ClusteringEventBus(EventBusTerminal terminal)
Initializes a ClusteringEventBus with the given terminal and a DefaultClusterSelector . |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClusteringEventBus()
ClusteringEventBus
with a SimpleEventBusTerminal
and a DefaultClusterSelector
. This causes dispatching to happen synchronously and places all subscribed event
handlers in a single cluster, making its default behavior similar to that of the SimpleEventBus
.
public ClusteringEventBus(EventBusTerminal terminal)
ClusteringEventBus
with the given terminal
and a DefaultClusterSelector
. This places all subscribed event handlers in a single cluster. The
terminal
is responsible for publishing incoming events in this cluster.
terminal
- The terminal responsible for dispatching events to the clusterspublic ClusteringEventBus(ClusterSelector clusterSelector)
ClusteringEventBus
with the given clusterSelector
and a SimpleEventBusTerminal
, which dispatches all events to all local clusters synchronously.
clusterSelector
- The Cluster Selector that chooses the cluster for each of the subscribed event listenerspublic ClusteringEventBus(ClusterSelector clusterSelector, EventBusTerminal terminal)
ClusteringEventBus
with the given clusterSelector
and a
terminal
.
clusterSelector
- The Cluster Selector that chooses the cluster for each of the subscribed event listenersterminal
- The terminal responsible for publishing incoming events to each of the clustersMethod Detail |
---|
public void publish(EventMessage... events)
EventBus
events
as a single batch and distribute the events as such to
all subscribed EventListeners.
publish
in interface EventBus
events
- The collection of events to publishpublic void subscribe(EventListener eventListener)
EventBus
eventListener
to this bus. When subscribed, it will receive all events
published to this bus.
If the given eventListener
is already subscribed, nothing happens.
subscribe
in interface EventBus
eventListener
- The event listener to subscribepublic void unsubscribe(EventListener eventListener)
EventBus
eventListener
to this bus. When unsubscribed, it will no longer receive
events
published to this bus.
unsubscribe
in interface EventBus
eventListener
- The event listener to unsubscribe
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |