org.axonframework.eventhandling
Class AutowiringClusterSelector

java.lang.Object
  extended by org.axonframework.eventhandling.AutowiringClusterSelector
All Implemented Interfaces:
ClusterSelector, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class AutowiringClusterSelector
extends Object
implements ClusterSelector, org.springframework.context.ApplicationContextAware

Cluster selector implementation that uses a Spring Application Context to find all selector beans available. It uses the Ordered interface to allow custom ordering of selectors. Selectors that do not implement the Ordered interface, are assumed to have an order of 0.

Since:
2.0
Author:
Allard Buijze

Constructor Summary
AutowiringClusterSelector()
           
 
Method Summary
 Cluster selectCluster(EventListener eventListener)
          Selects the cluster instance that the given eventListener should be member of.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutowiringClusterSelector

public AutowiringClusterSelector()
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

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException


Copyright © 2010-2016. All Rights Reserved.