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
,ComponentSourceAware
,ExpressionCapable
,ConnectionFactory
,NamedComponent
,ManageableLifecycle
A client connection factory that creates
TcpNetConnection
s.- Since:
- 2.0
- Author:
- Gary Russell, Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
connections, connectionsMonitor, DEFAULT_REPLY_TIMEOUT, lifecycleMonitor
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
-
Constructor Summary
ConstructorDescriptionTcpNetClientConnectionFactory
(String host, int port) Creates a TcpNetClientConnectionFactory for connections to the host and port. -
Method Summary
Modifier and TypeMethodDescriptionprotected TcpConnectionSupport
protected Socket
createSocket
(String host, int port) Create a newSocket
.protected TcpSocketFactorySupport
void
setTcpNetConnectionSupport
(TcpNetConnectionSupport connectionSupport) Set theTcpNetConnectionSupport
to use to create connection objects.void
setTcpSocketFactorySupport
(TcpSocketFactorySupport tcpSocketFactorySupport) Set theTcpSocketFactorySupport
used to create server sockets.void
start()
Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory
enableManualListenerRegistration, forceClose, getConnection, getConnectionTest, getConnectTimeout, getTheConnection, initializeConnection, obtainConnection, obtainNewConnection, obtainSharedConnection, setConnectionTest, setConnectTimeout, setTheConnection
Methods 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, wrapConnection
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getComponentType, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler
-
Constructor Details
-
TcpNetClientConnectionFactory
Creates a TcpNetClientConnectionFactory for connections to the host and port.- Parameters:
host
- the hostport
- the port
-
-
Method Details
-
buildNewConnection
- Overrides:
buildNewConnection
in classAbstractClientConnectionFactory
-
setTcpNetConnectionSupport
Set theTcpNetConnectionSupport
to use to create connection objects.- Parameters:
connectionSupport
- the connection support.- Since:
- 5.0
-
setTcpSocketFactorySupport
Set theTcpSocketFactorySupport
used to create server sockets.- Parameters:
tcpSocketFactorySupport
- theTcpSocketFactorySupport
-
getTcpSocketFactorySupport
-
start
public void start()- Specified by:
start
in interfaceLifecycle
- Specified by:
start
in interfaceManageableLifecycle
- Overrides:
start
in classAbstractConnectionFactory
-
createSocket
Create 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.
-