Package de.xima.fc.cluster.observer
Class ClusterTopologyObserver
- java.lang.Object
-
- de.xima.fc.cluster.observer.ClusterTopologyObserver
-
- All Implemented Interfaces:
IClusterTopologyObserver
,Serializable
public class ClusterTopologyObserver extends Object implements IClusterTopologyObserver
Default implementation ofIClusterTopologyObserver
that delegates to the registeredIClusterTopologyListener
.- Since:
- 3.1.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClusterTopologyObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(IClusterTopologyListener listener)
Adds a listener that will be invoked when an event related to a change in the cluster topology occurs.void
onNodeJoined(NodeJoinEvent event)
Method that should be called when a node was added to the cluster.void
onNodeLeft(NodeLeftEvent event)
Method that should be called when a node was removed from the cluster.void
removeListener(IClusterTopologyListener listener)
Removes a listener previously added viaIClusterTopologyObserver.addListener(IClusterTopologyListener)
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.cluster.interfaces.observer.IClusterTopologyObserver
onNodeCrashSuspect
-
-
-
-
Method Detail
-
onNodeJoined
public void onNodeJoined(NodeJoinEvent event)
Description copied from interface:IClusterTopologyObserver
Method that should be called when a node was added to the cluster. This method should invoke the appropriate listeners added viaIClusterTopologyObserver.addListener(IClusterTopologyListener)
.- Specified by:
onNodeJoined
in interfaceIClusterTopologyObserver
- Parameters:
event
- Details about the node that joined the cluster.
-
onNodeLeft
public void onNodeLeft(NodeLeftEvent event)
Description copied from interface:IClusterTopologyObserver
Method that should be called when a node was removed from the cluster. This method should invoke the appropriate listeners added viaIClusterTopologyObserver.addListener(IClusterTopologyListener)
.- Specified by:
onNodeLeft
in interfaceIClusterTopologyObserver
- Parameters:
event
- Details about the node that left the cluster.
-
addListener
public void addListener(IClusterTopologyListener listener)
Description copied from interface:IClusterTopologyObserver
Adds a listener that will be invoked when an event related to a change in the cluster topology occurs.- Specified by:
addListener
in interfaceIClusterTopologyObserver
- Parameters:
listener
- Listener to add that will be invoked when an event occurs.
-
removeListener
public void removeListener(IClusterTopologyListener listener)
Description copied from interface:IClusterTopologyObserver
Removes a listener previously added viaIClusterTopologyObserver.addListener(IClusterTopologyListener)
.- Specified by:
removeListener
in interfaceIClusterTopologyObserver
- Parameters:
listener
- Listener that should not be invoked anymore.
-
-