public class ClassNamePatternClusterSelector extends AbstractClusterSelector
EventListener
interface.
If a listener implements the EventListenerProxy
interface, the value of the EventListenerProxy.getTargetType()
is used. Annotated Event Listeners will always
have the actual annotated class name used.Constructor and Description |
---|
ClassNamePatternClusterSelector(Pattern pattern,
Cluster cluster)
Initializes the ClassNamePrefixClusterSelector using the given
mappings . |
Modifier and Type | Method and Description |
---|---|
Cluster |
doSelectCluster(EventListener eventListener,
Class listenerType)
Select a cluster for the given
eventListener , which has the actual class listenerType . |
selectCluster
public ClassNamePatternClusterSelector(Pattern pattern, Cluster cluster)
mappings
. If a name does not have a
prefix defined, the Cluster Selector returns the given defaultCluster
.pattern
- The pattern to match an Event Listener's class name againstcluster
- The cluster to choose when the pattern matchespublic Cluster doSelectCluster(EventListener eventListener, Class listenerType)
AbstractClusterSelector
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
.doSelectCluster
in class AbstractClusterSelector
eventListener
- The listener instance handling the events, possibly a proxylistenerType
- The actual type of the Event ListenerCopyright © 2010-2014. All Rights Reserved.