public class DefaultClusterSelector extends Object implements ClusterSelector
Constructor and Description |
---|
DefaultClusterSelector()
Initializes the DefaultClusterSelector using a
SimpleCluster with
identifier "default", to which this instance will assign all Event Listeners. |
DefaultClusterSelector(Cluster defaultCluster)
Initializes the DefaultClusterSelector to assign the given
defaultCluster to each listener. |
Modifier and Type | Method and Description |
---|---|
Cluster |
selectCluster(EventListener eventListener)
Selects the cluster instance that the given
eventListener should be member of. |
public DefaultClusterSelector()
SimpleCluster
with
identifier "default", to which this instance will assign all Event Listeners.public DefaultClusterSelector(Cluster defaultCluster)
defaultCluster
to each listener.defaultCluster
- The Cluster to assign to each listenerpublic Cluster selectCluster(EventListener eventListener)
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.
This implementation always returns the same instance of SimpleCluster
.selectCluster
in interface ClusterSelector
eventListener
- the event listener to select a cluster forCopyright © 2010-2014. All Rights Reserved.