public class NioTransport extends Object implements RtTransport
Modifier and Type | Class and Description |
---|---|
protected class |
NioTransport.Receiver |
Modifier and Type | Field and Description |
---|---|
protected SocketChannel |
client_channel |
protected boolean |
direct_buffers |
protected InetAddress |
host |
protected Log |
log |
protected int |
port |
protected RtReceiver |
receiver |
protected NioTransport.Receiver |
receiver_thread |
protected boolean |
server |
protected ServerSocketChannel |
srv_channel |
Constructor and Description |
---|
NioTransport() |
Modifier and Type | Method and Description |
---|---|
List<? extends Object> |
clusterMembers()
Returns the addresses of all cluster members.
|
Object |
localAddress()
Returns the local addres of this member.
|
String[] |
options()
Prints the accepted options, e.g.
|
void |
options(String... options)
Sets options on this transport.
|
void |
receiver(RtReceiver receiver)
Sets the receiver whose
RtReceiver.receive(Object,byte[],int,int) callback will be invoked whenever a
message is received |
void |
send(Object dest,
byte[] buf,
int offset,
int length)
Sends a message
|
void |
start(String... options)
Starts the transport, e.g.
|
void |
stop()
Stops the transport, e.g.
|
protected ServerSocketChannel srv_channel
protected SocketChannel client_channel
protected NioTransport.Receiver receiver_thread
protected RtReceiver receiver
protected InetAddress host
protected int port
protected boolean server
protected boolean direct_buffers
protected final Log log
public String[] options()
RtTransport
options
in interface RtTransport
public void options(String... options) throws Exception
RtTransport
RtTransport.start(String...)
is called,
but may also be called at runtime.options
in interface RtTransport
options
- The optionsException
public void receiver(RtReceiver receiver)
RtTransport
RtReceiver.receive(Object,byte[],int,int)
callback will be invoked whenever a
message is receivedreceiver
in interface RtTransport
public Object localAddress()
RtTransport
localAddress
in interface RtTransport
public List<? extends Object> clusterMembers()
RtTransport
clusterMembers
in interface RtTransport
public void start(String... options) throws Exception
RtTransport
start
in interface RtTransport
options
- Options passed to the transport at startup time. May be nullException
public void stop()
RtTransport
stop
in interface RtTransport
public void send(Object dest, byte[] buf, int offset, int length) throws Exception
RtTransport
send
in interface RtTransport
dest
- The destination addressbuf
- The bufferoffset
- The offset at which the data startslength
- The length (in bytes) of the data to sendException
Copyright © 2017 JBoss, a division of Red Hat. All rights reserved.