public class TcpSendingMessageHandler extends AbstractMessageHandler implements TcpSender, Lifecycle, ClientModeCapable
IntegrationManagement.ManagementOverrides| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_RETRY_INTERVAL
A default retry interval for the
ClientModeConnectionManager rescheduling. |
protected Object |
lifecycleMonitor |
EXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
TcpSendingMessageHandler() |
| Modifier and Type | Method and Description |
|---|---|
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 TcpConnection |
doWrite(Message<?> message)
Method that actually does the write.
|
protected ConnectionFactory |
getClientConnectionFactory() |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected Map<String,TcpConnection> |
getConnections() |
long |
getRetryInterval() |
protected ConnectionFactory |
getServerConnectionFactory() |
void |
handleMessageInternal(Message<?> message)
Writes the message payload to the underlying socket, using the specified
message format.
|
boolean |
isClientMode() |
boolean |
isClientModeConnected() |
boolean |
isRunning() |
protected TcpConnection |
obtainConnection(Message<?> message) |
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 |
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 |
setRetryInterval(long retryInterval) |
void |
start() |
void |
stop() |
configureMetrics, destroy, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMetricsCaptor, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiterrorCount, handleCountgetBeanName, getComponentNamepublic static final long DEFAULT_RETRY_INTERVAL
ClientModeConnectionManager rescheduling.protected final Object lifecycleMonitor
protected TcpConnection obtainConnection(Message<?> message)
public void handleMessageInternal(Message<?> message)
handleMessageInternal in class AbstractMessageHandlerMessageHandler.handleMessage(org.springframework.messaging.Message)protected TcpConnection 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 String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected void onInit()
IntegrationObjectSupportonInit in class AbstractMessageHandlerprotected ConnectionFactory getClientConnectionFactory()
protected ConnectionFactory getServerConnectionFactory()
protected Map<String,TcpConnection> getConnections()
public boolean isClientMode()
isClientMode in interface ClientModeCapablepublic void setClientMode(boolean isClientMode)
isClientMode - the isClientMode to setpublic long getRetryInterval()
public void setRetryInterval(long retryInterval)
retryInterval - the retryInterval to setpublic boolean isClientModeConnected()
isClientModeConnected in interface ClientModeCapablepublic void retryConnection()
ClientModeCapableretryConnection in interface ClientModeCapable