public class NioSender extends AbstractSender
Modifier and Type | Field and Description |
---|---|
protected XByteBuffer |
ackbuf |
protected boolean |
complete |
protected boolean |
connecting |
protected byte[] |
current |
protected java.nio.channels.DatagramChannel |
dataChannel |
protected java.nio.ByteBuffer |
readbuf |
protected int |
remaining |
protected java.nio.channels.Selector |
selector |
protected static StringManager |
sm |
protected java.nio.channels.SocketChannel |
socketChannel |
protected java.nio.ByteBuffer |
writebuf |
Constructor and Description |
---|
NioSender() |
Modifier and Type | Method and Description |
---|---|
void |
connect()
connect - blocking in this operation
|
void |
disconnect()
disconnect
TODO Implement this org.apache.catalina.tribes.transport.IDataSender method
|
byte[] |
getMessage() |
java.nio.channels.Selector |
getSelector() |
boolean |
isComplete() |
boolean |
process(java.nio.channels.SelectionKey key,
boolean waitForAck)
State machine to send data
|
protected boolean |
read() |
void |
reset() |
void |
setComplete(boolean complete) |
void |
setMessage(byte[] data)
sendMessage
|
void |
setMessage(byte[] data,
int offset,
int length) |
void |
setSelector(java.nio.channels.Selector selector) |
protected boolean |
write() |
getAddress, getAttempt, getConnectTime, getDestination, getDirectBuffer, getKeepAliveCount, getKeepAliveTime, getMaxRetryAttempts, getOoBInline, getPort, getRequestCount, getRxBufSize, getSoKeepAlive, getSoLingerOn, getSoLingerTime, getSoReuseAddress, getSoTrafficClass, getTcpNoDelay, getThrowOnFailedAck, getTimeout, getTxBufSize, getUdpPort, getUdpRxBufSize, getUdpTxBufSize, isConnected, isUdpBased, keepalive, setAddress, setAttempt, setConnected, setConnectTime, setDestination, setDirectBuffer, setKeepAliveCount, setKeepAliveTime, setMaxRetryAttempts, setOoBInline, setPort, setRequestCount, setRxBufSize, setSoKeepAlive, setSoLingerOn, setSoLingerTime, setSoReuseAddress, setSoTrafficClass, setTcpNoDelay, setThrowOnFailedAck, setTimeout, setTxBufSize, setUdpBased, setUdpPort, setUdpRxBufSize, setUdpTxBufSize, transferProperties
protected static final StringManager sm
protected java.nio.channels.Selector selector
protected java.nio.channels.SocketChannel socketChannel
protected java.nio.channels.DatagramChannel dataChannel
protected java.nio.ByteBuffer readbuf
protected java.nio.ByteBuffer writebuf
protected volatile byte[] current
protected final XByteBuffer ackbuf
protected int remaining
protected boolean complete
protected boolean connecting
public boolean process(java.nio.channels.SelectionKey key, boolean waitForAck) throws java.io.IOException
key
- SelectionKeyjava.io.IOException
protected boolean read() throws java.io.IOException
java.io.IOException
protected boolean write() throws java.io.IOException
java.io.IOException
public void connect() throws java.io.IOException
connect
in interface DataSender
connect
in class AbstractSender
java.io.IOException
- TODO Implement this org.apache.catalina.tribes.transport.IDataSender methodpublic void disconnect()
disconnect
in interface DataSender
disconnect
in class AbstractSender
public void reset()
public void setMessage(byte[] data) throws java.io.IOException
data
- ChannelMessagejava.io.IOException
- TODO Implement this org.apache.catalina.tribes.transport.IDataSender methodpublic void setMessage(byte[] data, int offset, int length) throws java.io.IOException
java.io.IOException
public byte[] getMessage()
public boolean isComplete()
public java.nio.channels.Selector getSelector()
public void setSelector(java.nio.channels.Selector selector)
public void setComplete(boolean complete)
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.