public abstract class SocketClientPoolSupport
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.apache.commons.pool.PoolableObjectFactory
SocketClient instances from the
Jakarta Commons Net library to handle
internet networking connections.| Constructor and Description |
|---|
SocketClientPoolSupport() |
| Modifier and Type | Method and Description |
|---|---|
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) |
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void destroy()
throws java.lang.Exception
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.Exceptionpublic org.apache.commons.net.SocketClient borrowClient()
throws java.lang.Exception
java.lang.Exceptionpublic void returnClient(org.apache.commons.net.SocketClient client)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Object makeObject()
throws java.lang.Exception
makeObject in interface org.apache.commons.pool.PoolableObjectFactoryjava.lang.Exceptionpublic void destroyObject(java.lang.Object object)
throws java.lang.Exception
destroyObject in interface org.apache.commons.pool.PoolableObjectFactoryjava.lang.Exceptionpublic boolean validateObject(java.lang.Object object)
validateObject in interface org.apache.commons.pool.PoolableObjectFactorypublic void activateObject(java.lang.Object object)
throws java.lang.Exception
activateObject in interface org.apache.commons.pool.PoolableObjectFactoryjava.lang.Exceptionpublic void passivateObject(java.lang.Object object)
throws java.lang.Exception
passivateObject in interface org.apache.commons.pool.PoolableObjectFactoryjava.lang.Exceptionpublic java.net.InetAddress getAddress()
public void setAddress(java.net.InetAddress address)
address - public java.lang.String getHost()
public void setHost(java.lang.String host)
host - public java.net.InetAddress getLocalAddress()
public void setLocalAddress(java.net.InetAddress localAddress)
localAddress - public int getLocalPort()
public void setLocalPort(int localPort)
localPort - public int getPort()
public void setPort(int port)
port - public org.apache.commons.pool.ObjectPool getPool()
public void setPool(org.apache.commons.pool.ObjectPool pool)
pool - protected void connect(org.apache.commons.net.SocketClient client)
throws java.io.IOException,
javax.jbi.JBIException,
java.lang.Exception
java.io.IOExceptionjavax.jbi.JBIExceptionjava.lang.Exceptionprotected void disconnect(org.apache.commons.net.SocketClient client)
throws java.lang.Exception
java.lang.Exceptionprotected abstract org.apache.commons.net.SocketClient createSocketClient()
Copyright © 2005-2016 FuseSource. All Rights Reserved.