Package org.jgroups.demos
Class RelayDemo
java.lang.Object
org.jgroups.demos.RelayDemo
- All Implemented Interfaces:
Receiver
Demos RELAY. Create 2 *separate* clusters with RELAY as top protocol. Each RELAY has bridge_props="tcp.xml" (tcp.xml
needs to be present). Then start 2 instances in the first cluster and 2 instances in the second cluster. They should
find each other, and typing in a window should send the text to everyone, plus we should get 4 responses.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected static voidhelp()static voidprotected Stringprotected booleanvoidCalled when a message is received.protected voidprotected voidstart(String props, String name, boolean print_route_status, boolean nohup, boolean use_view_handler) voidviewAccepted(View new_view) Called when a change in membership has occurred.
-
Field Details
-
SITE_MASTERS
- See Also:
-
SENDTO
- See Also:
-
ch
-
relay
-
-
Constructor Details
-
RelayDemo
public RelayDemo()
-
-
Method Details
-
main
- Throws:
Exception
-
receive
Description copied from interface:ReceiverCalled when a message is received. -
viewAccepted
Description copied from interface:ReceiverCalled when a change in membership has occurred. No long running actions, sending of messages or anything that could block should be done in this callback. If some long running action needs to be performed, it should be done in a separate thread.Note that on reception of the first view (a new member just joined), the channel will not yet be in the connected state. This only happens when
JChannel.connect(String)returns.- Specified by:
viewAcceptedin interfaceReceiver
-
start
protected void start(String props, String name, boolean print_route_status, boolean nohup, boolean use_view_handler) throws Exception - Throws:
Exception
-
eventLoop
-
process
-
sendTo
-
printTopo
-
help
protected static void help()
-