Package org.jgroups.demos
Class RelayDemoRpc
java.lang.Object
org.jgroups.demos.RelayDemoRpc
- 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
FieldsModifier and TypeFieldDescriptionprotected JChannelprotected RpcDispatcherprotected Stringprotected static final longprotected View -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringhandleMessage(String msg, String sender) static voidprotected static Collection<String> parseSiteMasters(String line) (package private) static StringvoidvoidviewAccepted(View new_view) Called when a change in membership has occurred.
-
Field Details
-
ch
-
disp
-
local_addr
-
view
-
RPC_TIMEOUT
protected static final long RPC_TIMEOUT- See Also:
-
-
Constructor Details
-
RelayDemoRpc
public RelayDemoRpc()
-
-
Method Details
-
main
- Throws:
Exception
-
start
- Throws:
Exception
-
parseSiteMasters
-
handleMessage
-
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
-
print
-