public class TcpOutboundGateway extends org.springframework.integration.handler.AbstractReplyProducingMessageHandler implements TcpSender, TcpListener, org.springframework.integration.support.management.ManageableLifecycle
Lifecycle methods delegate to the underlying AbstractConnectionFactory.
messagingTemplateEXPRESSION_PARSER, logger| 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() |
protected AbstractConnectionFactory |
getConnectionFactory() |
protected java.lang.Object |
handleRequestMessage(org.springframework.messaging.Message<?> requestMessage) |
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 |
setCloseStreamAfterSend(boolean closeStreamAfterSend)
Set to true to close the connection ouput stream after sending without
closing the connection.
|
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 |
setSecondChanceDelay(int secondChanceDelay)
When using NIO and the server closes the socket after sending the reply,
an error message representing the close may appear before the reply.
|
void |
setUnsolicitedMessageChannel(org.springframework.messaging.MessageChannel unsolicitedMessageChannel)
Set the channel for unsolicited incoming messages, or late replies.
|
void |
setUnsolicitedMessageChannelName(java.lang.String unsolicitedMessageChannelName)
Set the channel name for unsolicited incoming messages, or late replies.
|
void |
start() |
void |
stop() |
doInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadershandleMessage, onComplete, onError, onNext, onSubscribebuildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackafterPropertiesSet, 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, waitpublic void setConnectionFactory(AbstractClientConnectionFactory connectionFactory)
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)
public void setReplyChannel(org.springframework.messaging.MessageChannel replyChannel)
replyChannel - The reply channel.public void setReplyChannelName(java.lang.String replyChannel)
replyChannel - The reply channel.public void setUnsolicitedMessageChannelName(java.lang.String unsolicitedMessageChannelName)
unsolicitedMessageChannelName - the channel name.public void setUnsolicitedMessageChannel(org.springframework.messaging.MessageChannel unsolicitedMessageChannel)
unsolicitedMessageChannel - the channel.public void setCloseStreamAfterSend(boolean closeStreamAfterSend)
ByteArrayRawSerializer.
Requires a single-use connection factory.closeStreamAfterSend - true to close.public void setSecondChanceDelay(int secondChanceDelay)
ErrorMessage is
received. Default 2 seconds.secondChanceDelay - the delay.public java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.handler.MessageHandlerSupportprotected void doInit()
doInit in class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerprotected java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)
handleRequestMessage in class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerpublic boolean onMessage(org.springframework.messaging.Message<?> message)
TcpListeneronMessage in interface TcpListenermessage - The message.public 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 void start()
start in interface org.springframework.context.Lifecyclestart in interface org.springframework.integration.support.management.ManageableLifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclestop in interface org.springframework.integration.support.management.ManageableLifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.LifecycleisRunning in interface org.springframework.integration.support.management.ManageableLifecycleprotected AbstractConnectionFactory getConnectionFactory()