org.springframework.integration.ip.tcp.connection
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.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, NamedComponent, ConnectionFactory
public class TcpNetClientConnectionFactory
- extends AbstractClientConnectionFactory
A client connection factory that creates TcpNetConnection
s.
- Since:
- 2.0
- Author:
- Gary Russell
Constructor Summary |
TcpNetClientConnectionFactory(java.lang.String host,
int port)
Creates a TcpNetClientConnectionFactory for connections to the host and port. |
Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory |
addConnection, checkActive, doAccept, getDeserializer, getHost, getListener, getMapper, getPhase, getPoolSize, getPort, getSender, getSerializer, getSoLinger, getSoReceiveBufferSize, getSoSendBufferSize, getSoTimeout, getSoTrafficClass, getTaskExecutor, getTcpSocketSupport, harvestClosedConnections, isActive, isAutoStartup, isLookupHost, isRunning, isSingleUse, isSoKeepAlive, isSoTcpNoDelay, processNioSelections, registerListener, registerSender, setActive, setDeserializer, setInterceptorFactoryChain, setLookupHost, setMapper, setNioHarvestInterval, setPoolSize, setSerializer, setSingleUse, setSocketAttributes, setSoKeepAlive, setSoLinger, setSoReceiveBufferSize, setSoSendBufferSize, setSoTcpNoDelay, setSoTimeout, setSoTrafficClass, setTaskExecutor, setTcpSocketSupport, stop, stop, wrapConnection |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
obtainConnection
protected TcpConnection obtainConnection()
throws java.lang.Exception
- Specified by:
obtainConnection
in class AbstractClientConnectionFactory
- Throws:
java.io.IOException
java.net.SocketException
java.lang.Exception
start
public void start()
- Specified by:
start
in interface org.springframework.context.Lifecycle
- Overrides:
start
in class AbstractConnectionFactory
createSocket
protected java.net.Socket createSocket(java.lang.String host,
int port)
throws java.io.IOException
- Create a new
Socket
. This default implementation uses the default
SocketFactory
. Override to use some other mechanism
- Parameters:
host
- The host.port
- The port.
- Returns:
- The Socket
- Throws:
java.io.IOException
close
public void close()
- Description copied from class:
AbstractConnectionFactory
- Closes the server.
- Specified by:
close
in class AbstractConnectionFactory
getTcpSocketFactorySupport
protected TcpSocketFactorySupport getTcpSocketFactorySupport()
setTcpSocketFactorySupport
public void setTcpSocketFactorySupport(TcpSocketFactorySupport tcpSocketFactorySupport)