Package org.jgroups.tests
Class RpcDispatcherBlocking
java.lang.Object
org.jgroups.tests.RpcDispatcherBlocking
- All Implemented Interfaces:
Receiver
Tests synchronous group RPCs. 2 main test cases:
- Member crashes during invocation of sync group RPC: start 3 instances (A, B,C), set the timeout to be 30 seconds. Then invoke a sync group RPC by A (press 's' in A's window). A,B and C should receive the RPC. Now kill C. After some time, A's method call should return and show A's and B's reply to be valid, while showing C's response marked as suspected.
- Member joins group during synchronous group RPC: start A and B with timeout=30000. Invoke a sync group RPC on A. Start C. A and B should not receive the view change before the group RPC has returned with A's and B's results. Therefore A and B should not wait for C's response, which would never be received because C never got the RPC in the first place. This would block A forever.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
disp
RpcDispatcher disp -
channel
JChannel channel -
timeout
long timeout -
props
String props -
i
int i
-
-
Constructor Details
-
RpcDispatcherBlocking
-
-
Method Details
-
print
- Throws:
Exception
-
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
- Throws:
Exception
-
sendGroupRpc
- Throws:
Exception
-
main
-
help
static void help()
-