public class SocketWriterPoolFactory extends org.apache.commons.pool.BaseKeyedPoolableObjectFactory<HostAndPort,SocketWriter> implements org.apache.commons.pool.KeyedPoolableObjectFactory<HostAndPort,SocketWriter>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_SOCKET_CONNECT_TIMEOUT_IN_MILLIS |
| Constructor and Description |
|---|
SocketWriterPoolFactory(Charset charset,
int socketConnectTimeoutInMillis) |
SocketWriterPoolFactory(String charset,
int socketConnectTimeoutInMillis) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroyObject(HostAndPort HostAndPort,
SocketWriter socketWriter) |
SocketWriter |
makeObject(HostAndPort HostAndPort) |
boolean |
validateObject(HostAndPort HostAndPort,
SocketWriter socketWriter)
Defensive approach: we test all the "
Socket.isXXX()" flags. |
activateObject, passivateObjectpublic static final int DEFAULT_SOCKET_CONNECT_TIMEOUT_IN_MILLIS
public SocketWriterPoolFactory(String charset, int socketConnectTimeoutInMillis)
public SocketWriterPoolFactory(Charset charset, int socketConnectTimeoutInMillis)
public SocketWriter makeObject(HostAndPort HostAndPort) throws Exception
makeObject in interface org.apache.commons.pool.KeyedPoolableObjectFactory<HostAndPort,SocketWriter>makeObject in class org.apache.commons.pool.BaseKeyedPoolableObjectFactory<HostAndPort,SocketWriter>Exceptionpublic void destroyObject(HostAndPort HostAndPort, SocketWriter socketWriter) throws Exception
destroyObject in interface org.apache.commons.pool.KeyedPoolableObjectFactory<HostAndPort,SocketWriter>destroyObject in class org.apache.commons.pool.BaseKeyedPoolableObjectFactory<HostAndPort,SocketWriter>Exceptionpublic boolean validateObject(HostAndPort HostAndPort, SocketWriter socketWriter)
Socket.isXXX()" flags.validateObject in interface org.apache.commons.pool.KeyedPoolableObjectFactory<HostAndPort,SocketWriter>validateObject in class org.apache.commons.pool.BaseKeyedPoolableObjectFactory<HostAndPort,SocketWriter>Copyright © 2014. All Rights Reserved.