|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.ip.tcp.connection.AbstractTcpConnection org.springframework.integration.ip.tcp.connection.TcpNioConnection
public class TcpNioConnection
A TcpConnection that uses and underlying SocketChannel
.
Field Summary |
---|
Fields inherited from class org.springframework.integration.ip.tcp.connection.AbstractTcpConnection |
---|
logger |
Constructor Summary | |
---|---|
TcpNioConnection(java.nio.channels.SocketChannel socketChannel,
boolean server,
boolean lookupHost)
Constructs a TcpNetConnection for the SocketChannel. |
Method Summary | |
---|---|
protected java.nio.ByteBuffer |
allocate(int length)
Allocates a ByteBuffer of the requested length using normal or direct buffers, depending on the usingDirectBuffers field. |
void |
close()
Closes this connection. |
protected org.springframework.integration.ip.tcp.connection.TcpNioConnection.ChannelOutputStream |
getChannelOutputStream()
|
long |
getLastRead()
|
long |
getLastSend()
|
java.lang.Object |
getPayload()
Uses the deserializer to obtain the message payload from the connection's input stream. |
int |
getPort()
|
boolean |
isOpen()
|
protected boolean |
isUsingDirectBuffers()
|
void |
readPacket()
Invoked by the factory when there is data to be read. |
void |
run()
If there is no listener, and this connection is not for single use, this method exits. |
void |
send(Message<?> message)
Converts and sends the message. |
protected void |
sendToPipe(java.nio.ByteBuffer rawBuffer)
|
void |
setLastRead(long lastRead)
|
void |
setPipeTimeout(long pipeTimeout)
|
void |
setTaskExecutor(java.util.concurrent.Executor taskExecutor)
|
void |
setUsingDirectBuffers(boolean usingDirectBuffers)
If true, connection will attempt to use direct buffers where possible. |
Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractTcpConnection |
---|
afterSend, closeConnection, getConnectionId, getDeserializer, getHostAddress, getHostName, getListener, getMapper, getSender, getSerializer, incrementAndGetConnectionSequence, isNoReadErrorOnClose, isServer, isSingleUse, registerListener, registerSender, setDeserializer, setMapper, setNoReadErrorOnClose, setSerializer, setSingleUse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TcpNioConnection(java.nio.channels.SocketChannel socketChannel, boolean server, boolean lookupHost) throws java.lang.Exception
socketChannel
- the socketChannelserver
- if true this connection was created as
a result of an incoming request.
java.lang.Exception
Method Detail |
---|
public void setPipeTimeout(long pipeTimeout)
public void close()
AbstractTcpConnection
close
in interface TcpConnection
close
in class AbstractTcpConnection
public boolean isOpen()
public void send(Message<?> message) throws java.lang.Exception
TcpConnection
message
- The message
java.lang.Exception
public java.lang.Object getPayload() throws java.lang.Exception
TcpConnection
java.lang.Exception
public int getPort()
protected java.nio.ByteBuffer allocate(int length)
public void run()
protected void sendToPipe(java.nio.ByteBuffer rawBuffer) throws java.io.IOException
java.io.IOException
public void readPacket()
public void setTaskExecutor(java.util.concurrent.Executor taskExecutor)
taskExecutor
- the taskExecutor to setpublic void setUsingDirectBuffers(boolean usingDirectBuffers)
usingDirectBuffers
- protected boolean isUsingDirectBuffers()
protected org.springframework.integration.ip.tcp.connection.TcpNioConnection.ChannelOutputStream getChannelOutputStream()
public long getLastRead()
public void setLastRead(long lastRead)
lastRead
- The time of the last read.public long getLastSend()
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |