org.apache.servicemix.components.net
Class SocketClientPoolSupport

java.lang.Object
  extended by org.apache.servicemix.components.net.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 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: 2153 $

Constructor Summary
SocketClientPoolSupport()
           
 
Method Summary
 void activateObject(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(Object object)
           
protected  void disconnect(org.apache.commons.net.SocketClient client)
           
 InetAddress getAddress()
           
 String getHost()
           
 InetAddress getLocalAddress()
           
 int getLocalPort()
           
 org.apache.commons.pool.ObjectPool getPool()
           
 int getPort()
           
 Object makeObject()
           
 void passivateObject(Object object)
           
 void returnClient(org.apache.commons.net.SocketClient client)
           
 void setAddress(InetAddress address)
           
 void setHost(String host)
           
 void setLocalAddress(InetAddress localAddress)
           
 void setLocalPort(int localPort)
           
 void setPool(org.apache.commons.pool.ObjectPool pool)
           
 void setPort(int port)
           
 boolean validateObject(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 Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

destroy

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

borrowClient

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

returnClient

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

makeObject

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

destroyObject

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

validateObject

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

activateObject

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

passivateObject

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

getAddress

public InetAddress getAddress()

setAddress

public void setAddress(InetAddress address)

getHost

public String getHost()

setHost

public void setHost(String host)

getLocalAddress

public InetAddress getLocalAddress()

setLocalAddress

public void setLocalAddress(InetAddress localAddress)

getLocalPort

public int getLocalPort()

setLocalPort

public void setLocalPort(int localPort)

getPort

public int getPort()

setPort

public void setPort(int port)

getPool

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

setPool

public void setPool(org.apache.commons.pool.ObjectPool pool)

connect

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

disconnect

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

createSocketClient

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


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.