org.springframework.integration.ip.tcp
Class SimpleTcpNetInboundGateway
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.AbstractMessagingGateway
org.springframework.integration.ip.tcp.SimpleTcpNetInboundGateway
- All Implemented Interfaces:
- org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, NamedComponent
public class SimpleTcpNetInboundGateway
- extends AbstractMessagingGateway
Simple implementation of a TCP/IP inbound gateway; uses Socket
and socket reader thread hangs on receive for response; therefore no multiplexing
of incoming messages is supported. Delegates most of its work to a private
subclass of TcpNetReceivingChannelAdapter
, overriding the
processMessage() method.
Consequently, the pool size needs to be large enough to support the maximum
number of concurrent connections expected.
- Author:
- Gary Russell
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setChannelResolver, setConversionService, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
mapper
protected SocketMessageMapper mapper
delegate
protected org.springframework.integration.ip.tcp.SimpleTcpNetInboundGateway.WriteCapableTcpNetReceivingChannelAdapter delegate
port
protected int port
messageFormat
protected int messageFormat
poolSize
protected int poolSize
receiveBufferSize
protected int receiveBufferSize
soKeepAlive
protected boolean soKeepAlive
soReceiveBufferSize
protected int soReceiveBufferSize
soSendBufferSize
protected int soSendBufferSize
soTimeout
protected int soTimeout
customSocketReaderClassName
protected java.lang.String customSocketReaderClassName
customSocketWriterClass
protected java.lang.Class<NetSocketWriter> customSocketWriterClass
SimpleTcpNetInboundGateway
public SimpleTcpNetInboundGateway()
doStart
protected void doStart()
- Description copied from class:
AbstractEndpoint
- Subclasses must implement this method with the start behavior.
This method will be invoked while holding the
AbstractEndpoint.lifecycleLock
.
- Overrides:
doStart
in class AbstractMessagingGateway
doStop
protected void doStop()
- Description copied from class:
AbstractEndpoint
- Subclasses must implement this method with the stop behavior.
This method will be invoked while holding the
AbstractEndpoint.lifecycleLock
.
- Overrides:
doStop
in class AbstractMessagingGateway
onInit
protected void onInit()
throws java.lang.Exception
- Description copied from class:
IntegrationObjectSupport
- Subclasses may implement this for initialization logic.
- Overrides:
onInit
in class AbstractMessagingGateway
- Throws:
java.lang.Exception
fromMessage
protected java.lang.Object fromMessage(Message<?> message)
- Description copied from class:
AbstractMessagingGateway
- Subclasses must implement this to map from a Message to an Object.
- Specified by:
fromMessage
in class AbstractMessagingGateway
toMessage
protected Message<?> toMessage(java.lang.Object object)
- Description copied from class:
AbstractMessagingGateway
- Subclasses must implement this to map from an Object to a Message.
- Specified by:
toMessage
in class AbstractMessagingGateway
setPort
public void setPort(int port)
- Parameters:
port
- the port to set
setMessageFormat
public void setMessageFormat(int messageFormat)
- Parameters:
messageFormat
- the messageFormat to set
setPoolSize
public void setPoolSize(int poolSize)
- Parameters:
poolSize
- the poolSize to set
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize)
- Parameters:
receiveBufferSize
- the receiveBufferSize to set
setSoKeepAlive
public void setSoKeepAlive(boolean soKeepAlive)
- Parameters:
soKeepAlive
- the soKeepAlive to set
getPort
public int getPort()
- Returns:
- the port
setSoReceiveBufferSize
public void setSoReceiveBufferSize(int soReceiveBufferSize)
- Parameters:
soReceiveBufferSize
- the soReceiveBufferSize to set
setSoSendBufferSize
public void setSoSendBufferSize(int soSendBufferSize)
- Parameters:
soSendBufferSize
- the soSendBufferSize to set
setSoTimeout
public void setSoTimeout(int soTimeout)
- Parameters:
soTimeout
- the soTimeout to set
setCustomSocketReaderClassName
public void setCustomSocketReaderClassName(java.lang.String customSocketReaderClassName)
- Parameters:
customSocketReaderClassName
- the customSocketReaderClassName to set
setCustomSocketWriterClassName
public void setCustomSocketWriterClassName(java.lang.String customSocketWriterClassName)
throws java.lang.ClassNotFoundException
- Parameters:
customSocketWriterClassName
- the customSocketWriterClassName to set
- Throws:
java.lang.ClassNotFoundException