|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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 org.apache.commons.logging.Log |
logger
|
| 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 |
doWrite(Message<?> message)
Method that actually does the write. |
protected ConnectionFactory |
getClientConnectionFactory()
|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information. |
protected TcpConnection |
getConnection()
|
protected java.util.Map<java.lang.String,TcpConnection> |
getConnections()
|
int |
getPhase()
|
protected ConnectionFactory |
getServerConnectionFactory()
|
void |
handleMessageInternal(Message<?> message)
Writes the message payload to the underlying socket, using the specified message format. |
boolean |
isAutoStartup()
|
boolean |
isRunning()
|
void |
removeDeadConnection(TcpConnection connection)
When we are using sockets owned by a TcpListener, this
method is called each time a connection is closed. |
void |
setAutoStartup(boolean autoStartup)
|
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. |
void |
setPhase(int phase)
|
void |
start()
|
void |
stop()
|
void |
stop(java.lang.Runnable callback)
|
| 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 final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public TcpSendingMessageHandler()
| Method Detail |
|---|
protected TcpConnection getConnection()
public void handleMessageInternal(Message<?> message)
throws MessageRejectedException,
MessageHandlingException,
MessageDeliveryException
handleMessageInternal in class AbstractMessageHandlerMessageRejectedException
MessageHandlingException
MessageDeliveryExceptionMessageHandler.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)
TcpSenderTcpListener, this
method is called each time a new connection is made.
addNewConnection in interface TcpSenderconnection - The connection.public void removeDeadConnection(TcpConnection connection)
TcpSenderTcpListener, this
method is called each time a connection is closed.
removeDeadConnection in interface TcpSenderconnection - The connection.public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerpublic void start()
start in interface Lifecyclepublic void stop()
stop in interface Lifecyclepublic boolean isRunning()
isRunning in interface Lifecyclepublic int getPhase()
getPhase in interface Phasedpublic boolean isAutoStartup()
isAutoStartup in interface SmartLifecyclepublic void stop(java.lang.Runnable callback)
stop in interface SmartLifecyclepublic void setAutoStartup(boolean autoStartup)
public void setPhase(int phase)
protected ConnectionFactory getClientConnectionFactory()
protected ConnectionFactory getServerConnectionFactory()
protected java.util.Map<java.lang.String,TcpConnection> getConnections()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||