public abstract class AbstractCluster extends Object implements Cluster
Cluster
implementation that keeps track of Cluster members (EventListeners
).
This implementation is thread-safe. The getMembers()
method returns a read-only runtime view of the members
in the cluster.Constructor and Description |
---|
AbstractCluster() |
Modifier and Type | Method and Description |
---|---|
Set<EventListener> |
getMembers()
Returns a read-only view on the members in the cluster.
|
ClusterMetaData |
getMetaData()
Returns the MetaData of this Cluster.
|
void |
subscribe(EventListener eventListener)
Subscribe the given
eventListener to this cluster. |
void |
unsubscribe(EventListener eventListener)
Unsubscribes the given
eventListener from this cluster. |
public void subscribe(EventListener eventListener)
Cluster
eventListener
to this cluster. If the listener is already subscribed, nothing
happens.
While the Event Listeners is subscribed, it will receive all messages published to the cluster.public void unsubscribe(EventListener eventListener)
Cluster
eventListener
from this cluster. If the listener is already unsubscribed, or was
never subscribed, nothing happens.unsubscribe
in interface Cluster
eventListener
- the Event Listener instance to unsubscribepublic ClusterMetaData getMetaData()
Cluster
getMetaData
in interface Cluster
public Set<EventListener> getMembers()
Iterator.remove()
method to be
invoked.getMembers
in interface Cluster
Copyright © 2012. All Rights Reserved.