|
Spring Integration | ||||||||
| 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 java.lang.Object |
lifecycleMonitor
|
| Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
|---|
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()
|
long |
getRetryInterval()
|
protected org.springframework.scheduling.TaskScheduler |
getScheduler()
|
protected ConnectionFactory |
getServerConnectionFactory()
|
void |
handleMessageInternal(Message<?> message)
Writes the message payload to the underlying socket, using the specified message format. |
boolean |
isAutoStartup()
|
boolean |
isClientMode()
|
boolean |
isClientModeConnected()
|
boolean |
isRunning()
|
protected void |
onInit()
Subclasses may implement this for initialization logic. |
void |
removeDeadConnection(TcpConnection connection)
When we are using sockets owned by a TcpListener, this
method is called each time a connection is closed. |
void |
retryConnection()
Immediately attempt to establish the connection. |
void |
setAutoStartup(boolean autoStartup)
|
void |
setClientMode(boolean isClientMode)
|
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 |
setRetryInterval(long retryInterval)
|
void |
setScheduler(org.springframework.scheduling.TaskScheduler scheduler)
|
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, 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 java.lang.Object lifecycleMonitor
| 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 AbstractMessageHandler
protected void onInit()
throws java.lang.Exception
IntegrationObjectSupport
onInit in class IntegrationObjectSupportjava.lang.Exceptionpublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic int getPhase()
getPhase in interface org.springframework.context.Phasedpublic boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.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()
public boolean isClientMode()
isClientMode in interface ClientModeCapablepublic void setClientMode(boolean isClientMode)
isClientMode - the isClientMode to setprotected org.springframework.scheduling.TaskScheduler getScheduler()
public void setScheduler(org.springframework.scheduling.TaskScheduler scheduler)
scheduler - the scheduler to setpublic long getRetryInterval()
public void setRetryInterval(long retryInterval)
retryInterval - the retryInterval to setpublic boolean isClientModeConnected()
isClientModeConnected in interface ClientModeCapablepublic void retryConnection()
ClientModeCapable
retryConnection in interface ClientModeCapable
|
Spring Integration | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||