|
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.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, inputConverter, listener, logger, mapper, outputConverter, sender, server, singleUse |
Constructor Summary | |
---|---|
TcpNetConnection(Socket socket,
boolean server)
Constructs a TcpNetConnection for the socket. |
Method Summary | |
---|---|
void |
close()
Closes this connection. |
String |
getConnectionId()
|
String |
getHostAddress()
|
String |
getHostName()
|
Object |
getPayload()
Uses the input converter 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 |
---|
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 TcpNetConnection(Socket socket, boolean server)
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 Exception
TcpConnection
message
- The message
Exception
public String getHostAddress()
public String getHostName()
public Object getPayload() throws Exception
TcpConnection
Exception
public int getPort()
public void run()
InputStreamingConverter
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.
public String getConnectionId()
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |