org.atmosphere.plugin.jgroups
Class BroadcastMessage

java.lang.Object
  extended by org.atmosphere.plugin.jgroups.BroadcastMessage
All Implemented Interfaces:
Serializable

public class BroadcastMessage
extends Object
implements Serializable

Container for holding the true message when broadcasting between cluster nodes. It provides knowledge of 'who' sent the message, using the generated globally unique Id, clusterChannelId instead of a JChannel host. This is because the JGroupsChannel the sent it will get the message too and needs to know to discard it. The standard JGroupsFilter implementation uses the JChannel address, Example: org.atmosphere.plugins.jgroups.JGroupsFilter.receive() says... if (message.getSrc() != jchannel.getLocalAddress()) { This is not good enough if multiple JChannels are started on a single host, so each JGroupsChannel instance should have a globally unique Id instead and set that value into each BroadcastMessage it sends.

Author:
westraj
See Also:
Serialized Form

Constructor Summary
BroadcastMessage(String clusterChannelId, String topic, Object message)
           
 
Method Summary
 String getClusterChannelId()
           
 Object getMessage()
           
 String getTopic()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BroadcastMessage

public BroadcastMessage(String clusterChannelId,
                        String topic,
                        Object message)
Method Detail

getClusterChannelId

public String getClusterChannelId()
Returns:
the clusterChannelId

getTopic

public String getTopic()
Returns:
the topic

getMessage

public Object getMessage()
Returns:
the message


Copyright © 2013. All Rights Reserved.