org.apache.catalina.tribes.transport.nio
public class NioSender extends AbstractSender implements DataSender
| Modifier and Type | Field and Description |
|---|---|
protected XByteBuffer |
ackbuf |
protected boolean |
complete |
protected boolean |
connecting |
protected byte[] |
current |
protected static Log |
log |
protected java.nio.ByteBuffer |
readbuf |
protected int |
remaining |
protected java.nio.channels.Selector |
selector |
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
|
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(java.nio.channels.SelectionKey key) |
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(java.nio.channels.SelectionKey key) |
getAddress, getAttempt, getConnectTime, getDestination, getDirect, getDirectBuffer, getKeepAliveCount, getKeepAliveTime, getMaxRetryAttempts, getOoBInline, getPort, getRequestCount, getRxBufSize, getSoKeepAlive, getSoLingerOn, getSoLingerTime, getSoReuseAddress, getSoTrafficClass, getTcpNoDelay, getThrowOnFailedAck, getTimeout, getTxBufSize, isConnected, keepalive, setAddress, setAttempt, setConnected, setConnectTime, setDestination, setDirect, setDirectBuffer, setKeepAliveCount, setKeepAliveTime, setMaxRetryAttempts, setOoBInline, setPort, setRequestCount, setRxBufSize, setSoKeepAlive, setSoLingerOn, setSoLingerTime, setSoReuseAddress, setSoTrafficClass, setTcpNoDelay, setThrowOnFailedAck, setTimeout, setTxBufSize, transferPropertiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConnectTime, getRequestCount, isConnected, keepalive, setKeepAliveCount, setKeepAliveTime, setRxBufSize, setTimeout, setTxBufSizeprotected static Log log
protected java.nio.channels.Selector selector
protected java.nio.channels.SocketChannel socketChannel
protected java.nio.ByteBuffer readbuf
protected java.nio.ByteBuffer writebuf
protected byte[] current
protected 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.IOExceptionprotected boolean read(java.nio.channels.SelectionKey key)
throws java.io.IOException
java.io.IOExceptionprotected boolean write(java.nio.channels.SelectionKey key)
throws java.io.IOException
java.io.IOExceptionpublic void connect()
throws java.io.IOException
connect in interface DataSenderconnect in class AbstractSenderjava.io.IOExceptionpublic void disconnect()
disconnect in interface DataSenderdisconnect in class AbstractSenderpublic void reset()
public void setMessage(byte[] data)
throws java.io.IOException
data - ChannelMessagejava.io.IOExceptionpublic void setMessage(byte[] data,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionpublic 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-2013 Apache Software Foundation. All Rights Reserved.