Class TcpNetClientConnectionFactory
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.TcpNetClientConnectionFactory
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ApplicationEventPublisherAware,- Lifecycle,- ExpressionCapable,- ConnectionFactory,- NamedComponent,- ManageableLifecycle
A client connection factory that creates 
TcpNetConnections.- Since:
- 2.0
- Author:
- Gary Russell, Artem Bilan
- 
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 SummaryConstructorsConstructorDescriptionTcpNetClientConnectionFactory(String host, int port) Creates a TcpNetClientConnectionFactory for connections to the host and port.
- 
Method SummaryModifier and TypeMethodDescriptionprotected TcpConnectionSupportprotected SocketcreateSocket(String host, int port) Create a newSocket.protected TcpSocketFactorySupportvoidsetTcpNetConnectionSupport(TcpNetConnectionSupport connectionSupport) Set theTcpNetConnectionSupportto use to create connection objects.voidsetTcpSocketFactorySupport(TcpSocketFactorySupport tcpSocketFactorySupport) Set theTcpSocketFactorySupportused to create server sockets.voidstart()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, checkActive, 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, stop, 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, setTaskScheduler
- 
Constructor Details- 
TcpNetClientConnectionFactoryCreates a TcpNetClientConnectionFactory for connections to the host and port.- Parameters:
- host- the host
- port- the port
 
 
- 
- 
Method Details- 
buildNewConnection- Overrides:
- buildNewConnectionin class- AbstractClientConnectionFactory
 
- 
setTcpNetConnectionSupportSet theTcpNetConnectionSupportto use to create connection objects.- Parameters:
- connectionSupport- the connection support.
- Since:
- 5.0
 
- 
setTcpSocketFactorySupportSet theTcpSocketFactorySupportused to create server sockets.- Parameters:
- tcpSocketFactorySupport- the- TcpSocketFactorySupport
 
- 
getTcpSocketFactorySupport
- 
startpublic void start()- Specified by:
- startin interface- Lifecycle
- Specified by:
- startin interface- ManageableLifecycle
- Overrides:
- startin class- AbstractConnectionFactory
 
- 
createSocketCreate a newSocket. This default implementation uses the defaultSocketFactory. Override to use some other mechanism- Parameters:
- host- The host.
- port- The port.
- Returns:
- The Socket
- Throws:
- IOException- Any IOException.
 
 
-