org.axonframework.eventhandling
Class SimpleCluster
java.lang.Object
   org.axonframework.eventhandling.AbstractCluster
org.axonframework.eventhandling.AbstractCluster
       org.axonframework.eventhandling.SimpleCluster
org.axonframework.eventhandling.SimpleCluster
- All Implemented Interfaces: 
- Cluster, EventProcessingMonitorSupport
- public class SimpleCluster 
- extends AbstractCluster
A simple Cluster implementation that invokes each of the members of a cluster when an Event is published. When an
 Event Listener raises an exception, publication of the Event is aborted and the exception is propagated. No
 guarantees are given about the order of invocation of Event Listeners.
- Since:
- 1.2
- Author:
- ALlard Buijze
| Constructor Summary | 
| SimpleCluster(String name)Initializes the cluster with given
 name. | 
| SimpleCluster(String name,
              OrderResolver orderResolver)Initializes the cluster with given
 name, using givenorderResolverto define the
 order in which listeners need to be invoked. | 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
SimpleCluster
public SimpleCluster(String name)
- Initializes the cluster with given name.
 
- Parameters:
- name- The name of this cluster
 
SimpleCluster
public SimpleCluster(String name,
                     OrderResolver orderResolver)
- Initializes the cluster with given name, using givenorderResolverto define the
 order in which listeners need to be invoked.
 
 Listeners are invoked with the lowest order first.
 
- Parameters:
- name- The name of this cluster
- orderResolver- The resolver defining the order in which listeners need to be invoked
 
doPublish
public void doPublish(List<EventMessage> events,
                      Set<EventListener> eventListeners,
                      MultiplexingEventProcessingMonitor monitor)
- Description copied from class: AbstractCluster
- Publish the given list of eventsto the given set ofeventListeners, and notify the
 giveneventProcessingMonitorafter completion. The given set ofeventListenersis a
 live view on the memberships of the cluster. Any subscription changes are immediately visible in this set.
 Iterators created on the set iterate over an immutable view reflecting the state at the moment the iterator was
 created.
 
 When this method is invoked as part of a Unit of Work (seeCurrentUnitOfWork.isStarted()), the monitor invocation should be postponed
 until the Unit of Work is committed or rolled back, to ensure any transactions are properly propagated when the
 monitor is invoked.
 
 It is the implementation's responsibility to ensure that –eventually– the each of the giveneventsis provided to theeventProcessingMonitor, either to theEventProcessingMonitor.onEventProcessingCompleted(java.util.List)or theEventProcessingMonitor.onEventProcessingFailed(java.util.List, Throwable)method.
 
- 
- Specified by:
- doPublishin class- AbstractCluster
 
- 
- Parameters:
- events- The events to publish
- eventListeners- The event listeners subscribed at the moment the event arrived
- monitor- The monitor to notify after completion.
 
Copyright © 2010-2016. All Rights Reserved.