org.springframework.integration.ip.tcp
Class AbstractTcpReceivingChannelAdapter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.ip.AbstractInternetProtocolReceivingChannelAdapter
org.springframework.integration.ip.tcp.AbstractTcpReceivingChannelAdapter
- All Implemented Interfaces:
- java.lang.Runnable, 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, MessageProducer, CommonSocketOptions, ComponentMetadataProvider
- Direct Known Subclasses:
- TcpNetReceivingChannelAdapter, TcpNioReceivingChannelAdapter
public abstract class AbstractTcpReceivingChannelAdapter
- extends AbstractInternetProtocolReceivingChannelAdapter
Abstract class for tcp/ip incoming channel adapters. Implementations
for Socket
and SocketChannel
are provided.
- Author:
- Gary Russell
Method Summary |
void |
run()
Creates the ThreadPoolTaskScheduler, if necessary, and calls
server() . |
protected abstract void |
server()
Establishes the server. |
void |
setMessageFormat(int messageFormat)
|
void |
setPoolSize(int poolSize)
|
protected void |
setSocketOptions(java.net.Socket socket)
Sets soTimeout, soKeepAlive and tcpNoDelay according to the configured
properties. |
void |
setSoKeepAlive(boolean soKeepAlive)
|
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getBeanName, getChannelResolver, getComponentMetadata, getConversionService, getTaskScheduler, populateComponentMetadata, setBeanFactory, setBeanName, setChannelResolver, setConversionService, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
threadPoolTaskScheduler
protected volatile org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler threadPoolTaskScheduler
poolSize
protected volatile int poolSize
mapper
protected volatile SocketMessageMapper mapper
soKeepAlive
protected volatile boolean soKeepAlive
messageFormat
protected int messageFormat
AbstractTcpReceivingChannelAdapter
public AbstractTcpReceivingChannelAdapter(int port)
- Constructs a receiving channel adapter that listens on the port.
- Parameters:
port
- The port to listen on.
run
public void run()
- Creates the ThreadPoolTaskScheduler, if necessary, and calls
server()
.
server
protected abstract void server()
- Establishes the server.
setSocketOptions
protected void setSocketOptions(java.net.Socket socket)
throws java.net.SocketException
- Sets soTimeout, soKeepAlive and tcpNoDelay according to the configured
properties.
- Parameters:
socket
- The socket.
- Throws:
java.net.SocketException
setSoKeepAlive
public void setSoKeepAlive(boolean soKeepAlive)
- Parameters:
soKeepAlive
- the soKeepAlive to set- See Also:
Socket#setKeepAlive(boolean)}.
setMessageFormat
public void setMessageFormat(int messageFormat)
- Parameters:
messageFormat
- the messageFormat to set
setPoolSize
public void setPoolSize(int poolSize)
- Parameters:
poolSize
- the poolSize to set