|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.ip.tcp.TcpSendingMessageHandler
public class TcpSendingMessageHandler
Tcp outbound channel adapter using a TcpConnection to send data - if the connection factory is a server factory, the TcpListener owns the connections. If it is a client factory, this object owns the connection.
Field Summary | |
---|---|
protected ConnectionFactory |
clientConnectionFactory
|
protected TcpConnection |
connection
|
protected Map<String,TcpConnection> |
connections
|
protected org.apache.commons.logging.Log |
logger
|
protected ConnectionFactory |
serverConnectionFactory
|
Constructor Summary | |
---|---|
TcpSendingMessageHandler()
|
Method Summary | |
---|---|
void |
addNewConnection(TcpConnection connection)
When we are using sockets owned by a TcpListener , this
method is called each time a new connection is made. |
protected void |
close()
Close the underlying socket and prepare to establish a new socket on the next write. |
protected void |
doWrite(Message<?> message)
Method that actually does the write. |
protected TcpConnection |
getConnection()
|
void |
handleMessage(Message<?> message)
Writes the message payload to the underlying socket, using the specified message format. |
void |
removeDeadConnection(TcpConnection connection)
When we are using sockets owned by a TcpListener , this
method is called each time a connection is closed. |
void |
setConnectionFactory(AbstractConnectionFactory connectionFactory)
Sets the client or server connection factory; for this (an outbound adapter), if the factory is a server connection factory, the sockets are owned by a receiving channel adapter and this adapter is used to send replies. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.commons.logging.Log logger
protected TcpConnection connection
protected ConnectionFactory clientConnectionFactory
protected ConnectionFactory serverConnectionFactory
protected Map<String,TcpConnection> connections
Constructor Detail |
---|
public TcpSendingMessageHandler()
Method Detail |
---|
protected TcpConnection getConnection()
protected void close()
public void handleMessage(Message<?> message) throws MessageRejectedException, MessageHandlingException, MessageDeliveryException
handleMessage
in interface MessageHandler
message
- the message to be handled
MessageRejectedException
- if the handler doesn't select these
types of messages
MessageHandlingException
- when something went wrong during the
handling
MessageDeliveryException
- when this handler failed to deliver the
reply related to the handling of the messageMessageHandler.handleMessage(org.springframework.integration.Message)
protected void doWrite(Message<?> message)
message
- The message to write.public void setConnectionFactory(AbstractConnectionFactory connectionFactory)
connectionFactory
- the connectionFactory to setpublic void addNewConnection(TcpConnection connection)
TcpSender
TcpListener
, this
method is called each time a new connection is made.
addNewConnection
in interface TcpSender
connection
- The connection.public void removeDeadConnection(TcpConnection connection)
TcpSender
TcpListener
, this
method is called each time a connection is closed.
removeDeadConnection
in interface TcpSender
connection
- The connection.
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |