Class TcpNioClientConnectionFactory
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory
org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory
- All Implemented Interfaces:
- Runnable,- Aware,- BeanFactoryAware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ApplicationEventPublisherAware,- Lifecycle,- ExpressionCapable,- ConnectionFactory,- NamedComponent,- ManageableLifecycle,- SchedulingAwareRunnable
public class TcpNioClientConnectionFactory
extends AbstractClientConnectionFactory
implements SchedulingAwareRunnable
A client connection factory that creates 
TcpNioConnections.- Since:
- 2.0
- Author:
- Gary Russell, Artem Bilan, Christian Tzolov
- 
Field SummaryFields inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactoryconnections, connectionsMonitor, DEFAULT_REPLY_TIMEOUT, lifecycleMonitorFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, logger
- 
Constructor SummaryConstructorsConstructorDescriptionTcpNioClientConnectionFactory(String host, int port) Creates a TcpNioClientConnectionFactory for connections to the host and port.
- 
Method SummaryModifier and TypeMethodDescriptionprotected TcpConnectionSupportprotected voidprotected Map<SocketChannel,TcpNioConnection> protected BlockingQueue<SocketChannel>booleanprotected booleanvoidrun()voidsetTcpNioConnectionSupport(TcpNioConnectionSupport tcpNioSupport) voidsetUsingDirectBuffers(boolean usingDirectBuffers) When set to true, connections created by this factory attempt to use direct buffers where possible.voidstart()voidstop()Stops the server.Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactoryenableManualListenerRegistration, forceClose, getConnection, getConnectionTest, getConnectTimeout, getTheConnection, initializeConnection, obtainConnection, obtainNewConnection, obtainSharedConnection, setConnectionTest, setConnectTimeout, setTheConnectionMethods inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactoryaddConnection, closeConnection, delayRead, doAccept, getApplicationEventPublisher, getDelayedReads, getDeserializer, getHost, getLifecycleMonitor, getListener, getMapper, getOpenConnectionIds, getPort, getReadDelay, getSender, getSenders, getSerializer, getSoLinger, getSoReceiveBufferSize, getSoSendBufferSize, getSoTimeout, getSoTrafficClass, getSslHandshakeTimeout, getTaskExecutor, getTcpSocketSupport, harvestClosedConnections, isActive, isLookupHost, isRunning, isSingleUse, isSoKeepAlive, isSoTcpNoDelay, onInit, processNioSelections, registerListener, registerSender, setActive, setApplicationEventPublisher, setDeserializer, setHost, setInterceptorFactoryChain, setLeaveOpen, setLookupHost, setMapper, setNioHarvestInterval, setPort, setReadDelay, setSerializer, setSingleUse, setSocketAttributes, setSoKeepAlive, setSoLinger, setSoReceiveBufferSize, setSoSendBufferSize, setSoTcpNoDelay, setSoTimeout, setSoTrafficClass, setSslHandshakeTimeout, setTaskExecutor, setTcpSocketSupport, toString, unregisterSender, wrapConnectionMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskSchedulerMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.scheduling.SchedulingAwareRunnablegetQualifier
- 
Constructor Details- 
TcpNioClientConnectionFactoryCreates a TcpNioClientConnectionFactory for connections to the host and port.- Parameters:
- host- the host
- port- the port
 
 
- 
- 
Method Details- 
checkActiveprotected void checkActive()- Overrides:
- checkActivein class- AbstractConnectionFactory
 
- 
buildNewConnection- Overrides:
- buildNewConnectionin class- AbstractClientConnectionFactory
 
- 
setUsingDirectBufferspublic void setUsingDirectBuffers(boolean usingDirectBuffers) When set to true, connections created by this factory attempt to use direct buffers where possible.- Parameters:
- usingDirectBuffers- The usingDirectBuffers to set.
- See Also:
 
- 
setTcpNioConnectionSupport
- 
isLongLivedpublic boolean isLongLived()- Specified by:
- isLongLivedin interface- SchedulingAwareRunnable
 
- 
stoppublic void stop()Description copied from class:AbstractConnectionFactoryStops the server.- Specified by:
- stopin interface- Lifecycle
- Specified by:
- stopin interface- ManageableLifecycle
- Overrides:
- stopin class- AbstractConnectionFactory
 
- 
startpublic void start()- Specified by:
- startin interface- Lifecycle
- Specified by:
- startin interface- ManageableLifecycle
- Overrides:
- startin class- AbstractConnectionFactory
 
- 
runpublic void run()
- 
isUsingDirectBuffersprotected boolean isUsingDirectBuffers()- Returns:
- the usingDirectBuffers
 
- 
getConnections- Returns:
- the connections
 
- 
getNewChannels- Returns:
- the newChannels
 
 
-