|
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 |
---|
connectionId, inputConverter, listener, logger, mapper, outputConverter, sender, server, singleUse |
Constructor Summary | |
---|---|
TcpNioConnection(SocketChannel socketChannel,
boolean server)
Constructs a TcpNetConnection for the SocketChannel. |
Method Summary | |
---|---|
protected 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. |
String |
getConnectionId()
|
String |
getHostAddress()
|
String |
getHostName()
|
long |
getLastRead()
|
Object |
getPayload()
Uses the input converter 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(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 |
---|
getInputConverter, getListener, getMapper, getOutputConverter, isServer, isSingleUse, registerListener, registerSender, setInputConverter, setMapper, setOutputConverter, setSingleUse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TcpNioConnection(SocketChannel socketChannel, boolean server) throws Exception
socketChannel
- the socketChannelserver
- if true this connection was created as
a result of an incoming request.
Exception
Method Detail |
---|
public void close()
AbstractTcpConnection
close
in interface TcpConnection
close
in class AbstractTcpConnection
public boolean isOpen()
public void send(Message<?> message) throws Exception
TcpConnection
message
- The message
Exception
public String getHostAddress()
public String getHostName()
public Object getPayload() throws Exception
TcpConnection
Exception
public int getPort()
protected ByteBuffer allocate(int length)
public void run()
public void readPacket()
public void setTaskExecutor(Executor taskExecutor)
taskExecutor
- the taskExecutor to setpublic void setUsingDirectBuffers(boolean usingDirectBuffers)
usingDirectBuffers
- public String getConnectionId()
public long getLastRead()
public void setLastRead(long lastRead)
lastRead
- The time of the last read.
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |