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:
- Runnable, BeanFactoryAware, BeanNameAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, MessageProducer, NamedComponent, CommonSocketOptions
- 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.
- Since:
- 2.0
- Author:
- Gary Russell
Methods inherited from class org.springframework.integration.ip.AbstractInternetProtocolReceivingChannelAdapter |
checkTaskExecutor, doStart, doStop, getLocalAddress, getPort, isListening, setLocalAddress, setPoolSize, setReceiveBufferSize, setSoReceiveBufferSize, setSoSendBufferSize, setSoTimeout, setTaskExecutor |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, toString, writeMessageHistory |
mapper
protected volatile SocketMessageMapper mapper
soKeepAlive
protected volatile boolean soKeepAlive
messageFormat
protected volatile int messageFormat
close
protected volatile boolean close
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()
- Checks that we have a task executor and calls
server()
.
server
protected abstract void server()
- Establishes the server.
setSocketOptions
protected void setSocketOptions(Socket socket)
throws SocketException
- Sets soTimeout, soKeepAlive and tcpNoDelay according to the configured
properties.
- Parameters:
socket
- The socket.
- Throws:
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- See Also:
MessageFormats
setClose
public void setClose(boolean close)
- Parameters:
close
- the close to set
Copyright © 2010. All Rights Reserved.