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:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationEventPublisherAware,org.springframework.context.Lifecycle,org.springframework.integration.context.ExpressionCapable,ConnectionFactory,org.springframework.integration.support.context.NamedComponent,org.springframework.integration.support.management.ManageableLifecycle
public class TcpNetClientConnectionFactory extends AbstractClientConnectionFactory
A client connection factory that creates
TcpNetConnections.- Since:
- 2.0
-
Field Summary
Fields inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
DEFAULT_REPLY_TIMEOUT, lifecycleMonitor -
Constructor Summary
Constructors Constructor Description TcpNetClientConnectionFactory(java.lang.String host, int port)Creates a TcpNetClientConnectionFactory for connections to the host and port. -
Method Summary
Modifier and Type Method Description protected TcpConnectionSupportbuildNewConnection()protected java.net.SocketcreateSocket(java.lang.String host, int port)Create a newSocket.protected TcpSocketFactorySupportgetTcpSocketFactorySupport()voidsetTcpNetConnectionSupport(TcpNetConnectionSupport connectionSupport)Set theTcpNetConnectionSupportto use to create connection objects.voidsetTcpSocketFactorySupport(TcpSocketFactorySupport tcpSocketFactorySupport)voidstart()Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory
enableManualListenerRegistration, forceClose, getConnection, getConnectionTest, getConnectTimeout, getTheConnection, initializeConnection, obtainConnection, obtainNewConnection, obtainSharedConnection, setConnectionTest, setConnectTimeout, setTheConnectionMethods inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
addConnection, 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.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler
-
Constructor Details
-
TcpNetClientConnectionFactory
public TcpNetClientConnectionFactory(java.lang.String host, int port)Creates a TcpNetClientConnectionFactory for connections to the host and port.- Parameters:
host- the hostport- the port
-
-
Method Details
-
buildNewConnection
- Overrides:
buildNewConnectionin classAbstractClientConnectionFactory
-
setTcpNetConnectionSupport
Set theTcpNetConnectionSupportto use to create connection objects.- Parameters:
connectionSupport- the connection support.- Since:
- 5.0
-
setTcpSocketFactorySupport
-
getTcpSocketFactorySupport
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Specified by:
startin interfaceorg.springframework.integration.support.management.ManageableLifecycle- Overrides:
startin classAbstractConnectionFactory
-
createSocket
protected java.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOExceptionCreate 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:
java.io.IOException- Any IOException.
-