|
|||||||||
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.TcpNetConnection
public class TcpNetConnection
A TcpConnection that uses and underlying Socket
.
Field Summary |
---|
Fields inherited from class org.springframework.integration.ip.tcp.connection.AbstractTcpConnection |
---|
connectionId, deserializer, listener, logger, mapper, sender, serializer, server, singleUse |
Constructor Summary | |
---|---|
TcpNetConnection(java.net.Socket socket,
boolean server,
boolean lookupHost)
Constructs a TcpNetConnection for the socket. |
Method Summary | |
---|---|
void |
close()
Closes this connection. |
java.lang.Object |
getPayload()
Uses the deserializer to obtain the message payload from the connection's input stream. |
int |
getPort()
|
boolean |
isOpen()
|
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. |
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 TcpNetConnection(java.net.Socket socket, boolean server, boolean lookupHost)
socket
- the socketserver
- if true this connection was created as
a result of an incoming request.Method Detail |
---|
public void close()
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()
public void run()
Deserializer
and the listener's
TcpListener.onMessage(Message)
method is called. For single use
connections with no listener, the socket is closed after its timeout
expires. If data is received on a single use socket with no listener,
a warning is logged.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |