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

java.lang.Object
  extended by org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
      extended by org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory
All Implemented Interfaces:
java.lang.Runnable, Lifecycle, Phased, SmartLifecycle, ConnectionFactory
Direct Known Subclasses:
TcpNetClientConnectionFactory, TcpNioClientConnectionFactory

public abstract class AbstractClientConnectionFactory
extends AbstractConnectionFactory

Abstract class for client connection factories; client connection factories establish outgoing connections.

Since:
2.0

Field Summary
protected  TcpConnection theConnection
           
 
Fields inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
active, DEFAULT_REPLY_TIMEOUT, deserializer, host, interceptorFactoryChain, lifecycleMonitor, listener, logger, mapper, poolSize, port, sender, serializer, singleUse, soTimeout
 
Constructor Summary
AbstractClientConnectionFactory(java.lang.String host, int port)
          Constructs a factory that will established connections to the host and port.
 
Method Summary
protected  void initializeConnection(TcpConnection connection, java.net.Socket socket)
          Transfers attributes such as (de)serializers, singleUse etc to a new connection.
 
Methods inherited from class org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
addConnection, close, doAccept, getHost, getPhase, getPort, getSoLinger, getSoReceiveBufferSize, getSoSendBufferSize, getSoTimeout, getSoTrafficClass, getTaskExecutor, harvestClosedConnections, isAutoStartup, isLookupHost, isSingleUse, isSoKeepAlive, isSoTcpNoDelay, processNioSelections, registerListener, registerSender, setDeserializer, setInterceptorFactoryChain, setLookupHost, setMapper, setPoolSize, setSerializer, setSingleUse, setSocketAttributes, setSoKeepAlive, setSoLinger, setSoReceiveBufferSize, setSoSendBufferSize, setSoTcpNoDelay, setSoTimeout, setSoTrafficClass, setTaskExecutor, start, stop, stop, wrapConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.ip.tcp.connection.ConnectionFactory
getConnection
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface org.springframework.context.Lifecycle
isRunning
 

Field Detail

theConnection

protected TcpConnection theConnection
Constructor Detail

AbstractClientConnectionFactory

public AbstractClientConnectionFactory(java.lang.String host,
                                       int port)
Constructs a factory that will established connections to the host and port.

Parameters:
host - The host.
port - The port.
Method Detail

initializeConnection

protected void initializeConnection(TcpConnection connection,
                                    java.net.Socket socket)
Transfers attributes such as (de)serializers, singleUse etc to a new connection. When the connection factory has a reference to a TCPListener (to read responses), or for single use connections, the connection is executed. Single use connections need to read from the connection in order to close it after the socket timeout.

Parameters:
connection - The new connection.
socket - The new socket.