Package org.jgroups.tests
Class RpcDispatcherBlocking
- java.lang.Object
-
- org.jgroups.tests.RpcDispatcherBlocking
-
- All Implemented Interfaces:
Receiver
public class RpcDispatcherBlocking extends java.lang.Object implements 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.
-
-
Constructor Summary
Constructors Constructor Description RpcDispatcherBlocking(java.lang.String props, long timeout)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static voidhelp()static voidmain(java.lang.String[] args)voidprint(int i)(package private) RspListsendGroupRpc()voidstart()voidviewAccepted(View new_view)Called when a change in membership has occurred.
-
-
-
Field Detail
-
disp
RpcDispatcher disp
-
channel
JChannel channel
-
timeout
long timeout
-
props
java.lang.String props
-
i
int i
-
-
Method Detail
-
print
public void print(int i) throws java.lang.Exception- Throws:
java.lang.Exception
-
viewAccepted
public void viewAccepted(View new_view)
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 whenJChannel.connect(String)returns.- Specified by:
viewAcceptedin interfaceReceiver
-
start
public void start() throws java.lang.Exception- Throws:
java.lang.Exception
-
sendGroupRpc
RspList sendGroupRpc() throws java.lang.Exception
- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String[] args)
-
help
static void help()
-
-