Package org.jgroups.tests.rt
Interface RtTransport
-
- All Known Implementing Classes:
JGroupsTransport,NioTransport,ServerTransport,TcpTransport,UdpTransport
public interface RtTransportTransport for theRoundTriptest- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<? extends java.lang.Object>clusterMembers()Returns the addresses of all cluster members.java.lang.ObjectlocalAddress()Returns the local addres of this member.java.lang.String[]options()Prints the accepted options, e.g.voidoptions(java.lang.String... options)Sets options on this transport.voidreceiver(RtReceiver receiver)Sets the receiver whoseRtReceiver.receive(Object,byte[],int,int)callback will be invoked whenever a message is receivedvoidsend(java.lang.Object dest, byte[] buf, int offset, int length)Sends a messagevoidstart(java.lang.String... options)Starts the transport, e.g.voidstop()Stops the transport, e.g.
-
-
-
Method Detail
-
options
java.lang.String[] options()
Prints the accepted options, e.g. [-host host] [-port port] [-server host]- Returns:
-
options
void options(java.lang.String... options) throws java.lang.ExceptionSets options on this transport. Usually done after creation and beforestart(String...)is called, but may also be called at runtime.- Parameters:
options- The options- Throws:
java.lang.Exception
-
receiver
void receiver(RtReceiver receiver)
Sets the receiver whoseRtReceiver.receive(Object,byte[],int,int)callback will be invoked whenever a message is received- Parameters:
receiver-
-
localAddress
java.lang.Object localAddress()
Returns the local addres of this member.- Returns:
- The local address. Implementations without cluster membership may return null
-
clusterMembers
java.util.List<? extends java.lang.Object> clusterMembers()
Returns the addresses of all cluster members. May return null if not implemented- Returns:
- The list of all members in the cluster
-
start
void start(java.lang.String... options) throws java.lang.ExceptionStarts the transport, e.g. connecting to a server socket- Parameters:
options- Options passed to the transport at startup time. May be null- Throws:
java.lang.Exception
-
stop
void stop()
Stops the transport, e.g. stopping the accept() loop in a TCP-based server
-
send
void send(java.lang.Object dest, byte[] buf, int offset, int length) throws java.lang.ExceptionSends a message- Parameters:
dest- The destination addressbuf- The bufferoffset- The offset at which the data startslength- The length (in bytes) of the data to send- Throws:
java.lang.Exception
-
-