public class TcpReceivingChannelAdapter extends MessageProducerSupport implements TcpListener, ClientModeCapable, OrderlyShutdownCapable
lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
DEFAULT_PHASE
Constructor and Description |
---|
TcpReceivingChannelAdapter() |
Modifier and Type | Method and Description |
---|---|
int |
afterShutdown()
Called after normal shutdown of schedulers, executors etc,
and after the shutdown delay has elapsed, but before any
forced shutdown of any remaining active scheduler/executor
threads.Can optionally return the number of active messages
still in process.
|
int |
beforeShutdown()
Called before shutdown begins.
|
protected void |
doStart()
Take no action by default.
|
protected void |
doStop()
Take no action by default.
|
protected ConnectionFactory |
getClientConnectionFactory() |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
long |
getRetryInterval() |
protected ConnectionFactory |
getServerConnectionFactory() |
boolean |
isClientMode() |
boolean |
isClientModeConnected() |
boolean |
isListening() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
boolean |
onMessage(Message<?> message)
Called by a TCPConnection when a new message arrives.
|
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 inbound adapter), if
the factory is a client connection factory, the sockets are owned by a sending
channel adapter and this adapter is used to receive replies.
|
void |
setRetryInterval(long retryInterval) |
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
afterPropertiesSet, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBeanName, getComponentName
public boolean onMessage(Message<?> message)
TcpListener
onMessage
in interface TcpListener
message
- The message.protected void onInit()
IntegrationObjectSupport
onInit
in class MessageProducerSupport
protected void doStart()
MessageProducerSupport
doStart
in class MessageProducerSupport
protected void doStop()
MessageProducerSupport
doStop
in class MessageProducerSupport
public void setConnectionFactory(AbstractConnectionFactory connectionFactory)
connectionFactory
- the connectionFactory to setpublic boolean isListening()
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected ConnectionFactory getClientConnectionFactory()
protected ConnectionFactory getServerConnectionFactory()
public boolean isClientMode()
isClientMode
in interface ClientModeCapable
public 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 ClientModeCapable
public void retryConnection()
ClientModeCapable
retryConnection
in interface ClientModeCapable
public int beforeShutdown()
OrderlyShutdownCapable
beforeShutdown
in interface OrderlyShutdownCapable
public int afterShutdown()
OrderlyShutdownCapable
afterShutdown
in interface OrderlyShutdownCapable