org.atmosphere.plugin.jgroups
Class BroadcastMessage
java.lang.Object
org.atmosphere.plugin.jgroups.BroadcastMessage
- All Implemented Interfaces:
- java.io.Serializable
public class BroadcastMessage
- extends java.lang.Object
- implements java.io.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(java.lang.String clusterChannelId,
java.lang.String topic,
java.lang.Object message)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BroadcastMessage
public BroadcastMessage(java.lang.String clusterChannelId,
java.lang.String topic,
java.lang.Object message)
getClusterChannelId
public java.lang.String getClusterChannelId()
- Returns:
- the clusterChannelId
getTopic
public java.lang.String getTopic()
- Returns:
- the topic
getMessage
public java.lang.Object getMessage()
- Returns:
- the message
Copyright © 2012. All Rights Reserved.