org.springframework.integration.ip.tcp
Class TcpNioReceivingChannelAdapter
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
org.springframework.integration.ip.tcp.TcpNioReceivingChannelAdapter
- All Implemented Interfaces:
- Runnable, BeanFactoryAware, BeanNameAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, MessageProducer, NamedComponent, CommonSocketOptions
public class TcpNioReceivingChannelAdapter
- extends AbstractTcpReceivingChannelAdapter
Tcp Receiving Channel adapter that uses a SocketChannel
.
Sockets are multiplexed across the pooled threads. More than one thread will
be required with large numbers of connections and incoming traffic. The
number of threads is controlled by the poolSize property.
- Since:
- 2.0
- Author:
- Gary Russell
Methods inherited from class org.springframework.integration.ip.AbstractInternetProtocolReceivingChannelAdapter |
checkTaskExecutor, doStart, 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 |
serverChannel
protected ServerSocketChannel serverChannel
usingDirectBuffers
protected boolean usingDirectBuffers
customSocketReaderClass
protected Class<NioSocketReader> customSocketReaderClass
TcpNioReceivingChannelAdapter
public TcpNioReceivingChannelAdapter(int port)
- Constructs a TcpNioReceivingChannelAdapter to listen on the port.
- Parameters:
port
- The port.
server
protected void server()
- Opens a non-blocking
ServerSocketChannel
, registers it with a
Selector
and calls doSelect(ServerSocketChannel, Selector)
.
- Specified by:
server
in class AbstractTcpReceivingChannelAdapter
- See Also:
AbstractTcpReceivingChannelAdapter.server()
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 AbstractInternetProtocolReceivingChannelAdapter
setUsingDirectBuffers
public void setUsingDirectBuffers(boolean usingDirectBuffers)
- Parameters:
usingDirectBuffers
- Set true if you wish to use direct buffers
for NIO operations.
setCustomSocketReaderClassName
public void setCustomSocketReaderClassName(String customSocketReaderClassName)
throws ClassNotFoundException
- Parameters:
customSocketReaderClassName
- the customSocketReaderClassName to set
- Throws:
ClassNotFoundException
Copyright © 2010. All Rights Reserved.