public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler implements TcpSender, TcpListener, org.springframework.context.Lifecycle
SmartLifecycle
methods delegate to the underlying AbstractConnectionFactory
AbstractReplyProducingMessageHandler.RequestHandler
IntegrationManagement.ManagementOverrides
messagingTemplate
EXPRESSION_PARSER, logger
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
TcpOutboundGateway() |
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 void |
doInit() |
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected AbstractConnectionFactory |
getConnectionFactory() |
protected java.lang.Object |
handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
boolean |
isRunning() |
boolean |
onMessage(org.springframework.messaging.Message<?> message)
Called by a TCPConnection when a new message arrives.
|
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(AbstractClientConnectionFactory connectionFactory) |
void |
setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext) |
void |
setRemoteTimeout(long remoteTimeout) |
void |
setRemoteTimeoutExpression(org.springframework.expression.Expression remoteTimeoutExpression) |
void |
setReplyChannel(org.springframework.messaging.MessageChannel replyChannel)
Specify the Spring Integration reply channel.
|
void |
setReplyChannelName(java.lang.String replyChannel)
Specify the Spring Integration reply channel name.
|
void |
setRequestTimeout(long requestTimeout) |
void |
start() |
void |
stop() |
doInvokeAdvisedRequestHandler, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReply
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeaders
configureMetrics, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabled
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public void setRequestTimeout(long requestTimeout)
requestTimeout
- the requestTimeout to setpublic void setRemoteTimeout(long remoteTimeout)
remoteTimeout
- the remoteTimeout to setpublic void setRemoteTimeoutExpression(org.springframework.expression.Expression remoteTimeoutExpression)
remoteTimeoutExpression
- the remoteTimeoutExpression to setpublic void setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext)
protected void doInit()
doInit
in class AbstractReplyProducingMessageHandler
protected java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)
AbstractReplyProducingMessageHandler
handleRequestMessage
in class AbstractReplyProducingMessageHandler
requestMessage
- The request message.null
.public boolean onMessage(org.springframework.messaging.Message<?> message)
TcpListener
onMessage
in interface TcpListener
message
- The message.public void setConnectionFactory(AbstractClientConnectionFactory connectionFactory)
public 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 void setReplyChannel(org.springframework.messaging.MessageChannel replyChannel)
replyChannel
- The reply channel.public void setReplyChannelName(java.lang.String replyChannel)
replyChannel
- The reply channel.public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class AbstractMessageHandler
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
protected AbstractConnectionFactory getConnectionFactory()