public class SchoonerSockIOFactory
extends org.apache.commons.pool.BasePoolableObjectFactory
SchoonerSockIOFactory is used to create and destroy socket for
connection pool.SchoonerSockIOFactory| Modifier and Type | Field and Description |
|---|---|
protected int |
bufferSize |
protected String |
host |
protected boolean |
isTcp |
protected boolean |
nagle |
protected int |
socketConnectTO |
protected org.apache.commons.pool.impl.GenericObjectPool |
sockets |
protected int |
socketTO |
| Constructor and Description |
|---|
SchoonerSockIOFactory(String host,
boolean isTcp,
int bufferSize,
int socketTO,
int socketConnectTO,
boolean nagle) |
| Modifier and Type | Method and Description |
|---|---|
protected SchoonerSockIO |
createSocket(String host)
Creates a new SockIO obj for the given server.
|
void |
destroyObject(Object obj) |
Object |
makeObject() |
void |
setSockets(org.apache.commons.pool.impl.GenericObjectPool sockets) |
boolean |
validateObject(Object obj) |
protected org.apache.commons.pool.impl.GenericObjectPool sockets
protected String host
protected int bufferSize
protected int socketTO
protected int socketConnectTO
protected boolean isTcp
protected boolean nagle
public SchoonerSockIOFactory(String host, boolean isTcp, int bufferSize, int socketTO, int socketConnectTO, boolean nagle)
public Object makeObject() throws Exception
makeObject in interface org.apache.commons.pool.PoolableObjectFactorymakeObject in class org.apache.commons.pool.BasePoolableObjectFactoryExceptionpublic void destroyObject(Object obj) throws Exception
destroyObject in interface org.apache.commons.pool.PoolableObjectFactorydestroyObject in class org.apache.commons.pool.BasePoolableObjectFactoryExceptionpublic boolean validateObject(Object obj)
validateObject in interface org.apache.commons.pool.PoolableObjectFactoryvalidateObject in class org.apache.commons.pool.BasePoolableObjectFactoryprotected final SchoonerSockIO createSocket(String host) throws Exception
host - host:port to connect toExceptionpublic void setSockets(org.apache.commons.pool.impl.GenericObjectPool sockets)
Copyright © 2013 Schooner Information Technology. All Rights Reserved.