|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.context.IntegrationObjectSupport org.springframework.integration.handler.AbstractMessageHandler org.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 java.util.Map<java.lang.String,TcpConnection> |
connections
|
protected org.apache.commons.logging.Log |
logger
|
protected ConnectionFactory |
serverConnectionFactory
|
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
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. |
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information. |
protected TcpConnection |
getConnection()
|
void |
handleMessageInternal(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 org.springframework.integration.handler.AbstractMessageHandler |
---|
getOrder, handleMessage, setOrder, setShouldTrack |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.integration.context.NamedComponent |
---|
getComponentName |
Field Detail |
---|
protected org.apache.commons.logging.Log logger
protected TcpConnection connection
protected ConnectionFactory clientConnectionFactory
protected ConnectionFactory serverConnectionFactory
protected java.util.Map<java.lang.String,TcpConnection> connections
Constructor Detail |
---|
public TcpSendingMessageHandler()
Method Detail |
---|
protected TcpConnection getConnection()
protected void close()
public void handleMessageInternal(Message<?> message) throws MessageRejectedException, MessageHandlingException, MessageDeliveryException
handleMessageInternal
in class AbstractMessageHandler
MessageRejectedException
MessageHandlingException
MessageDeliveryException
MessageHandler.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.public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class AbstractMessageHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |