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:
java.lang.Runnable, 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  TcpConnection getOrMakeConnection()
           
 void run()
           
 
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, 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, start, 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

getOrMakeConnection

protected TcpConnection getOrMakeConnection()
                                     throws java.lang.Exception
Specified by:
getOrMakeConnection in class AbstractClientConnectionFactory
Throws:
java.io.IOException
java.net.SocketException
java.lang.Exception

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

run

public void run()

Spring Integration