org.axonframework.eventhandling
Class AnnotationClusterSelector
java.lang.Object
org.axonframework.eventhandling.AbstractClusterSelector
org.axonframework.eventhandling.AnnotationClusterSelector
- All Implemented Interfaces:
- ClusterSelector
public class AnnotationClusterSelector
- extends AbstractClusterSelector
Cluster Selector implementation that selects a cluster if an Annotation is present on the Event Listener class. Note
that this class will not search superclasses for annotations. If annotation on classes should also reflect
on their subclasses, make sure to use the @Inherited Meta-Annotation.
- Since:
- 2.0
- Author:
- Allard Buijze
|
Constructor Summary |
AnnotationClusterSelector(Class<? extends Annotation> annotationType,
Cluster cluster)
Initializes a ClusterSelector instance that selects the given cluster for Event Listeners that are
annotated with the given annotationType. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnotationClusterSelector
public AnnotationClusterSelector(Class<? extends Annotation> annotationType,
Cluster cluster)
- Initializes a ClusterSelector instance that selects the given
cluster for Event Listeners that are
annotated with the given annotationType.
- Parameters:
annotationType - The type of annotation to find on the Event Listenerscluster - The cluster to select if the annotation was found
doSelectCluster
protected Cluster doSelectCluster(EventListener eventListener,
Class<?> listenerType)
- Description copied from class:
AbstractClusterSelector
- Select a cluster for the given
eventListener, which has the actual class listenerType.
Note that the given listenerType does not have to be assignable to EventListener, as
it is possible that the eventListener acts as a proxy to an instance of listenerType.
- Specified by:
doSelectCluster in class AbstractClusterSelector
- Parameters:
eventListener - The listener instance handling the events, possibly a proxylistenerType - The actual type of the Event Listener
- Returns:
- the cluster to assign the Event Listener to
Copyright © 2010-2012. All Rights Reserved.