Package de.xima.fc.cluster.observer
Class ClusterChannelStateObserver
- java.lang.Object
-
- de.xima.fc.cluster.observer.ClusterChannelStateObserver
-
- All Implemented Interfaces:
IClusterChannelStateObserver
,Serializable
public class ClusterChannelStateObserver extends Object implements IClusterChannelStateObserver
Default implementation of aIClusterChannelStateObserver
that delegates to the registeredIClusterChannelStateListener
.- Since:
- 3.1.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClusterChannelStateObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(IClusterChannelStateListener listener)
Adds a listener that will be invoked when an event related to a change in a channel occurs.void
closed(ChannelCommunicationData channelData)
Method that should be called when the channel was closed.void
connected(ChannelCommunicationData channelData)
Method that should be called when the connection to a node was established.void
disconnected(ChannelCommunicationData channelData)
Method that should be called when the connection to a node was cut.void
removeListener(IClusterChannelStateListener listener)
Removes a listener previously added viaIClusterChannelStateObserver.addListener(IClusterChannelStateListener)
.
-
-
-
Method Detail
-
connected
public void connected(ChannelCommunicationData channelData)
Description copied from interface:IClusterChannelStateObserver
Method that should be called when the connection to a node was established. This method should invoke the appropriate listeners added viaIClusterChannelStateObserver.addListener(IClusterChannelStateListener)
.- Specified by:
connected
in interfaceIClusterChannelStateObserver
- Parameters:
channelData
- Details about the current state of the channel for the node.
-
disconnected
public void disconnected(ChannelCommunicationData channelData)
Description copied from interface:IClusterChannelStateObserver
Method that should be called when the connection to a node was cut. As long as the channel is not closed, the connection could be established later again. This method should invoke the appropriate listeners added viaIClusterChannelStateObserver.addListener(IClusterChannelStateListener)
.- Specified by:
disconnected
in interfaceIClusterChannelStateObserver
- Parameters:
channelData
- Details about the current state of the channel for the node.
-
closed
public void closed(ChannelCommunicationData channelData)
Description copied from interface:IClusterChannelStateObserver
Method that should be called when the channel was closed. Once the channel is closed, no more connections can be established anymore. This method should invoke the appropriate listeners added viaIClusterChannelStateObserver.addListener(IClusterChannelStateListener)
.- Specified by:
closed
in interfaceIClusterChannelStateObserver
- Parameters:
channelData
- Details about the current state of the channel for the node.
-
addListener
public void addListener(IClusterChannelStateListener listener)
Description copied from interface:IClusterChannelStateObserver
Adds a listener that will be invoked when an event related to a change in a channel occurs.- Specified by:
addListener
in interfaceIClusterChannelStateObserver
- Parameters:
listener
- Listener to add that will be invoked when an event occurs.
-
removeListener
public void removeListener(IClusterChannelStateListener listener)
Description copied from interface:IClusterChannelStateObserver
Removes a listener previously added viaIClusterChannelStateObserver.addListener(IClusterChannelStateListener)
.- Specified by:
removeListener
in interfaceIClusterChannelStateObserver
- Parameters:
listener
- Listener that should not be invoked anymore.
-
-