org.axonframework.eventhandling
Class CompositeClusterSelector

java.lang.Object
  extended by org.axonframework.eventhandling.CompositeClusterSelector
All Implemented Interfaces:
ClusterSelector

public class CompositeClusterSelector
extends Object
implements ClusterSelector

ClusterSelector implementation that delegates the selection to a list of other ClusterSelectors. The first of the delegates is asked for a Cluster. If it provides none, the second is invoked, and so forth, until a delegate returns a Cluster instance.

Since:
2.0
Author:
Allard Buijze

Constructor Summary
CompositeClusterSelector(List<ClusterSelector> delegates)
          Initializes the CompositeClusterSelector with the given List of delegates.
 
Method Summary
 Cluster selectCluster(EventListener eventListener)
          Selects the cluster instance that the given eventListener should be member of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeClusterSelector

public CompositeClusterSelector(List<ClusterSelector> delegates)
Initializes the CompositeClusterSelector with the given List of delegates. The delegates are evaluated in the order provided by the List's iterator.

Parameters:
delegates - the delegates to evaluate
Method Detail

selectCluster

public Cluster selectCluster(EventListener eventListener)
Description copied from interface: ClusterSelector
Selects the cluster instance that the given eventListener should be member of. This may be an existing (or pre-configured) cluster, as well as a newly created cluster.

When null is returned, this may cause the Event Listener not to be subscribed to any cluster at all.

Specified by:
selectCluster in interface ClusterSelector
Parameters:
eventListener - the event listener to select a cluster for
Returns:
The Cluster assigned to the listener


Copyright © 2010-2016. All Rights Reserved.