Package de.xima.fc.cluster.observer
Class ClusterChannelStateObserver
java.lang.Object
de.xima.fc.cluster.observer.ClusterChannelStateObserver
- All Implemented Interfaces:
IClusterChannelStateObserver
,Serializable
Default implementation of a
IClusterChannelStateObserver
that delegates to the registered
IClusterChannelStateListener
.- Since:
- 3.1.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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)
.
-
Constructor Details
-
ClusterChannelStateObserver
public ClusterChannelStateObserver()
-
-
Method Details
-
connected
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
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
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
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
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.
-