org.apache.servicemix.ftp
Class SocketClientPoolSupport

java.lang.Object
  extended by org.apache.servicemix.ftp.SocketClientPoolSupport
All Implemented Interfaces:
org.apache.commons.pool.PoolableObjectFactory, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
FTPClientPool

public abstract class SocketClientPoolSupport
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.apache.commons.pool.PoolableObjectFactory

A pool of SocketClient instances from the Jakarta Commons Net library to handle internet networking connections.

Version:
$Revision: 426415 $

Constructor Summary
SocketClientPoolSupport()
           
 
Method Summary
 void activateObject(java.lang.Object object)
           
 void afterPropertiesSet()
           
 org.apache.commons.net.SocketClient borrowClient()
           
protected  void connect(org.apache.commons.net.SocketClient client)
           
protected abstract  org.apache.commons.net.SocketClient createSocketClient()
           
 void destroy()
           
 void destroyObject(java.lang.Object object)
           
protected  void disconnect(org.apache.commons.net.SocketClient client)
           
 java.net.InetAddress getAddress()
           
 java.lang.String getHost()
           
 java.net.InetAddress getLocalAddress()
           
 int getLocalPort()
           
 org.apache.commons.pool.ObjectPool getPool()
           
 int getPort()
           
 java.lang.Object makeObject()
           
 void passivateObject(java.lang.Object object)
           
 void returnClient(org.apache.commons.net.SocketClient client)
           
 void setAddress(java.net.InetAddress address)
          Set the remote internet address to connect to.
 void setHost(java.lang.String host)
          Set the remote host name to connect to.
 void setLocalAddress(java.net.InetAddress localAddress)
          Set the local IP address to be used when establishing the connection.
 void setLocalPort(int localPort)
          Set the local TCP/IP port to be used when establishing the connection.
 void setPool(org.apache.commons.pool.ObjectPool pool)
          Set a custom ObjectPool instance to use for the connection pooling.
 void setPort(int port)
          Set the remote port number to connect to.
 boolean validateObject(java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketClientPoolSupport

public SocketClientPoolSupport()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
java.lang.Exception

borrowClient

public org.apache.commons.net.SocketClient borrowClient()
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

returnClient

public void returnClient(org.apache.commons.net.SocketClient client)
                  throws java.lang.Exception
Throws:
java.lang.Exception

makeObject

public java.lang.Object makeObject()
                            throws java.lang.Exception
Specified by:
makeObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

destroyObject

public void destroyObject(java.lang.Object object)
                   throws java.lang.Exception
Specified by:
destroyObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

validateObject

public boolean validateObject(java.lang.Object object)
Specified by:
validateObject in interface org.apache.commons.pool.PoolableObjectFactory

activateObject

public void activateObject(java.lang.Object object)
                    throws java.lang.Exception
Specified by:
activateObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

passivateObject

public void passivateObject(java.lang.Object object)
                     throws java.lang.Exception
Specified by:
passivateObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

getAddress

public java.net.InetAddress getAddress()

setAddress

public void setAddress(java.net.InetAddress address)
Set the remote internet address to connect to.

Parameters:
address -

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)
Set the remote host name to connect to.

Parameters:
host -

getLocalAddress

public java.net.InetAddress getLocalAddress()

setLocalAddress

public void setLocalAddress(java.net.InetAddress localAddress)
Set the local IP address to be used when establishing the connection.

Parameters:
localAddress -

getLocalPort

public int getLocalPort()

setLocalPort

public void setLocalPort(int localPort)
Set the local TCP/IP port to be used when establishing the connection.

Parameters:
localPort -

getPort

public int getPort()

setPort

public void setPort(int port)
Set the remote port number to connect to.

Parameters:
port -

getPool

public org.apache.commons.pool.ObjectPool getPool()

setPool

public void setPool(org.apache.commons.pool.ObjectPool pool)
Set a custom ObjectPool instance to use for the connection pooling.

Parameters:
pool -

connect

protected void connect(org.apache.commons.net.SocketClient client)
                throws java.io.IOException,
                       javax.jbi.JBIException,
                       java.lang.Exception
Throws:
java.io.IOException
javax.jbi.JBIException
java.lang.Exception

disconnect

protected void disconnect(org.apache.commons.net.SocketClient client)
                   throws java.lang.Exception
Throws:
java.lang.Exception

createSocketClient

protected abstract org.apache.commons.net.SocketClient createSocketClient()


Copyright © 2005-2012 FuseSource. All Rights Reserved.