Package de.xima.fc.cluster.observer
Class ClusterMessageObserver
- java.lang.Object
-
- de.xima.fc.cluster.observer.ClusterMessageObserver
-
- All Implemented Interfaces:
IClusterMessageObserver
,Serializable
public class ClusterMessageObserver extends Object implements IClusterMessageObserver
Default implementation ofIClusterMessageObserver
that delegates to the registeredIClusterMessageListener
.- Since:
- 3.1.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClusterMessageObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(IClusterMessageListener listener)
Adds a listener that will be invoked when an event related to messages between nodes occurs.void
receiveMessage(NodeMessageEvent event)
Method that should be called when a message sent by a node was received.void
removeListener(IClusterMessageListener listener)
Removes a listener previously added viaIClusterMessageObserver.addListener(IClusterMessageListener)
.
-
-
-
Method Detail
-
receiveMessage
public void receiveMessage(NodeMessageEvent event)
Description copied from interface:IClusterMessageObserver
Method that should be called when a message sent by a node was received. This method should invoke the appropriate listeners added viaIClusterMessageObserver.addListener(IClusterMessageListener)
.- Specified by:
receiveMessage
in interfaceIClusterMessageObserver
- Parameters:
event
- Event with details about the received message.
-
addListener
public void addListener(IClusterMessageListener listener)
Description copied from interface:IClusterMessageObserver
Adds a listener that will be invoked when an event related to messages between nodes occurs.- Specified by:
addListener
in interfaceIClusterMessageObserver
- Parameters:
listener
- Listener to add that will be invoked when an event occurs.
-
removeListener
public void removeListener(IClusterMessageListener listener)
Description copied from interface:IClusterMessageObserver
Removes a listener previously added viaIClusterMessageObserver.addListener(IClusterMessageListener)
.- Specified by:
removeListener
in interfaceIClusterMessageObserver
- Parameters:
listener
- Listener that should not be invoked anymore.
-
-