Package org.jgroups.tests
Class UnicastTestRpc
- java.lang.Object
-
- org.jgroups.tests.UnicastTestRpc
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classUnicastTestRpc.Invoker
-
Field Summary
Fields Modifier and Type Field Description private intanycast_countprivate java.util.Collection<Address>anycast_mbrsprivate booleananycastingprivate JChannelchannelprivate Addressdestinationprivate RpcDispatcherdispprivate java.lang.Stringgroupnameprivate Addresslocal_addrprivate static java.lang.reflect.Method[]METHODSprivate intmsg_sizeprivate intnum_msgsprotected java.util.concurrent.atomic.AtomicIntegernum_requestsprivate intnum_threadsprivate booleanoobprivate intprintprivate static java.lang.reflect.MethodRECEIVEprivate booleansync
-
Constructor Summary
Constructors Constructor Description UnicastTestRpc()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voideventLoop()private AddressgetReceiver()protected static java.util.List<java.lang.String>getSites(JChannel channel)(package private) static voidhelp()voidinit(java.lang.String props, java.lang.String name, java.lang.String cluster_name)(package private) voidinvokeRpcs()static voidmain(java.lang.String[] args)(package private) voidpopulateAnycastList(View view)(package private) voidprintView()static voidreceiveData(byte[] data)(package private) voidsetAnycastCount()(package private) voidsetMessageSize()(package private) voidsetNumMessages()(package private) voidsetSenderThreads()(package private) voidstop()voidviewAccepted(View new_view)Called when a change in membership has occurred.
-
-
-
Field Detail
-
channel
private JChannel channel
-
local_addr
private Address local_addr
-
disp
private RpcDispatcher disp
-
groupname
private java.lang.String groupname
-
sync
private boolean sync
-
oob
private boolean oob
-
anycasting
private boolean anycasting
-
num_threads
private int num_threads
-
num_msgs
private int num_msgs
-
msg_size
private int msg_size
-
print
private int print
-
anycast_count
private int anycast_count
-
anycast_mbrs
private final java.util.Collection<Address> anycast_mbrs
-
destination
private Address destination
-
RECEIVE
private static final java.lang.reflect.Method RECEIVE
-
METHODS
private static final java.lang.reflect.Method[] METHODS
-
num_requests
protected final java.util.concurrent.atomic.AtomicInteger num_requests
-
-
Method Detail
-
init
public void init(java.lang.String props, java.lang.String name, java.lang.String cluster_name) throws java.lang.Exception- Throws:
java.lang.Exception
-
stop
void stop()
-
receiveData
public static void receiveData(byte[] data)
-
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
-
eventLoop
public void eventLoop() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
invokeRpcs
void invokeRpcs() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
setSenderThreads
void setSenderThreads() throws java.lang.Exception- Throws:
java.lang.Exception
-
setNumMessages
void setNumMessages() throws java.lang.Exception- Throws:
java.lang.Exception
-
setMessageSize
void setMessageSize() throws java.lang.Exception- Throws:
java.lang.Exception
-
setAnycastCount
void setAnycastCount() throws java.lang.Exception- Throws:
java.lang.Exception
-
populateAnycastList
void populateAnycastList(View view)
-
printView
void printView()
-
getReceiver
private Address getReceiver()
-
getSites
protected static java.util.List<java.lang.String> getSites(JChannel channel)
-
main
public static void main(java.lang.String[] args)
-
help
static void help()
-
-