|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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 |
|---|
connectionId, deserializer, listener, logger, mapper, sender, serializer, server, singleUse |
| 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. |
long |
getLastRead()
|
java.lang.Object |
getPayload()
Uses the deserializer to obtain the message payload from the connection's input stream. |
int |
getPort()
|
boolean |
isOpen()
|
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. |
void |
setLastRead(long lastRead)
|
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, getConnectionSeq, getDeserializer, getHostAddress, getHostName, getListener, getMapper, getSerializer, isServer, isSingleUse, registerListener, registerSender, setDeserializer, setMapper, 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 close()
AbstractTcpConnection
close in interface TcpConnectionclose in class AbstractTcpConnectionpublic 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.Exceptionpublic int getPort()
protected java.nio.ByteBuffer allocate(int length)
public void run()
public void readPacket()
public void setTaskExecutor(java.util.concurrent.Executor taskExecutor)
taskExecutor - the taskExecutor to setpublic void setUsingDirectBuffers(boolean usingDirectBuffers)
usingDirectBuffers - public long getLastRead()
public void setLastRead(long lastRead)
lastRead - The time of the last read.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||