|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgroups.ReceiverAdapter
org.atmosphere.plugin.jgroups.JGroupsChannel
public class JGroupsChannel
JGroupsChannel establishes a connection to a JGroups cluster. It sends/receives over that and forwards the received messages to the appropriate Broadcaster on its node. Best practice would have only 1 of these per Atmosphere application. Each JGroupsFilter instance has a reference to the singleton JGroupsChannel object and registers its broadcaster via the addBroadcaster() method.
| Constructor Summary | |
|---|---|
JGroupsChannel(org.jgroups.JChannel jchannel,
String clusterName)
Constructor |
|
| Method Summary | |
|---|---|
void |
addBroadcaster(org.atmosphere.cpr.Broadcaster broadcaster)
Adds/replaces the broadcaster to the JGroupsChannel |
void |
destroy()
Shutdown the cluster. |
void |
init()
Connect to the cluster |
void |
receive(org.jgroups.Message jgroupMessage)
|
void |
removeBroadcaster(org.atmosphere.cpr.Broadcaster broadcaster)
Removes the broadcaster from the JGroupsChannel |
void |
send(String topic,
Object message)
Called from a ClusterBroadcastFilter filter() method to send the message over to other Atmosphere cluster nodes |
| Methods inherited from class org.jgroups.ReceiverAdapter |
|---|
block, getState, setState, suspect, unblock, viewAccepted |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JGroupsChannel(org.jgroups.JChannel jchannel,
String clusterName)
jchannel - unconnected JGroups JChannel objectclusterName - name of the group to connect the JChannel to| Method Detail |
|---|
public void init()
throws Exception
Exceptionpublic void destroy()
public void receive(org.jgroups.Message jgroupMessage)
receive in interface org.jgroups.MessageListenerreceive in class org.jgroups.ReceiverAdapter
public void send(String topic,
Object message)
topic - message - public void addBroadcaster(org.atmosphere.cpr.Broadcaster broadcaster)
broadcaster - public void removeBroadcaster(org.atmosphere.cpr.Broadcaster broadcaster)
broadcaster -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||