public class TcpInboundGateway extends org.springframework.integration.gateway.MessagingGatewaySupport implements TcpListener, TcpSender, ClientModeCapable, org.springframework.integration.context.OrderlyShutdownCapable
TcpOutboundGateway
multiplexing
is not used, but multiple concurrent connections can be used if the connection factory uses
single-use connections. For true asynchronous bi-directional communication, a pair of
inbound / outbound channel adapters should be used.Constructor and Description |
---|
TcpInboundGateway() |
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. |
int |
afterShutdown() |
int |
beforeShutdown() |
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
getComponentType() |
long |
getRetryInterval() |
boolean |
isClientMode() |
boolean |
isClientModeConnected() |
boolean |
isListening() |
protected void |
onInit() |
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 |
retryConnection()
Immediately attempt to establish the connection.
|
void |
setClientMode(boolean isClientMode) |
void |
setConnectionFactory(AbstractConnectionFactory connectionFactory)
|
void |
setRetryInterval(long retryInterval) |
receive, send, sendAndReceive, sendAndReceiveMessage, setErrorChannel, setErrorChannelName, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrack
doStop, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
afterPropertiesSet, getApplicationContext, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, toString
public boolean onMessage(org.springframework.messaging.Message<?> message)
TcpListener
onMessage
in interface TcpListener
message
- The message.public boolean isListening()
public void setConnectionFactory(AbstractConnectionFactory connectionFactory)
connectionFactory
- the Connection Factorypublic 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 java.lang.String getComponentType()
getComponentType
in interface org.springframework.integration.support.context.NamedComponent
getComponentType
in class org.springframework.integration.gateway.MessagingGatewaySupport
protected void onInit() throws java.lang.Exception
onInit
in class org.springframework.integration.gateway.MessagingGatewaySupport
java.lang.Exception
protected void doStart()
doStart
in class org.springframework.integration.gateway.MessagingGatewaySupport
protected void doStop()
doStop
in class org.springframework.integration.gateway.MessagingGatewaySupport
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()
beforeShutdown
in interface org.springframework.integration.context.OrderlyShutdownCapable
public int afterShutdown()
afterShutdown
in interface org.springframework.integration.context.OrderlyShutdownCapable