Spring Integration

org.springframework.integration.ip.tcp.connection
Class TcpNetClientConnectionFactory

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
          extended by org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory
              extended by 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 TcpNetConnections.

Since:
2.0
Author:
Gary Russell

Field Summary
 
Fields inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
DEFAULT_REPLY_TIMEOUT, lifecycleMonitor
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
TcpNetClientConnectionFactory(java.lang.String host, int port)
          Creates a TcpNetClientConnectionFactory for connections to the host and port.
 
Method Summary
 void close()
          Closes the server.
protected  java.net.Socket createSocket(java.lang.String host, int port)
          Create a new Socket.
protected  TcpSocketFactorySupport getTcpSocketFactorySupport()
           
protected  TcpConnection obtainConnection()
           
 void setTcpSocketFactorySupport(TcpSocketFactorySupport tcpSocketFactorySupport)
           
 void start()
           
 
Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory
forceClose, getConnection, getTheConnection, initializeConnection, setTheConnection
 
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
 

Constructor Detail

TcpNetClientConnectionFactory

public TcpNetClientConnectionFactory(java.lang.String host,
                                     int port)
Creates a TcpNetClientConnectionFactory for connections to the host and port.

Parameters:
host - the host
port - the port
Method Detail

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)

Spring Integration