public class TcpReceivingChannelAdapter extends MessageProducerSupport implements TcpListener, ClientModeCapable, OrderlyShutdownCapable
logger
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()
Takes no action by default.
|
protected void |
doStop()
Takes 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) |
sendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrack
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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