public class EPPSessionPool
extends java.lang.Object
init
methods must be
called before useing the pool. The init()
method uses configuration
settings defined in the Environment
class. The
Environment
settings include the following:maxActive
sessions should be pre-initialized at
initialization in the init()
method. Default is false
.
borrowObject()
. Default is
0
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT
Name of the default system session pool, which uses the
borrowObject() , returnObject(EPPSession) , and
invalidateObject(EPPSession) . |
static long |
DEFAULT_ABSOLUTE_TIMEOUT
The default session absolute timeout.
|
static long |
DEFAULT_IDLE_TIMEOUT
The default session absolute timeout.
|
static int |
DEFAULT_MAX_ACTIVE
The default cap on the total number of active instances from the pool.
|
static int |
DEFAULT_MAX_IDLE
The default cap on the number of "sleeping" instances in the pool.
|
static long |
DEFAULT_MAX_WAIT
The default maximum amount of time (in millis) the
borrowObject()
method should block before throwing an exception. |
static int |
DEFAULT_MIN_IDLE
The default minimum number of "sleeping" instances in the pool before
before the evictor thread (if active) spawns new objects.
|
static long |
DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
The default "time between eviction runs" value.
|
protected static EPPSessionPool |
instance
Singleton instance
|
Modifier | Constructor and Description |
---|---|
protected |
EPPSessionPool()
Default constructor as part of the Singleton Design Pattern.
|
Modifier and Type | Method and Description |
---|---|
EPPSession |
borrowObject()
Borrows a session from the pool.
|
EPPSession |
borrowObject(java.lang.String aSystem)
Borrows a session from the pool.
|
void |
close()
Closes the session pool(s) contained in
EPPSessionPool
cleanly. |
long |
getAbsoluteTimeout()
Gets the session absolute timeout.
|
java.lang.String |
getClientHost()
Gets the TCP server IP address or host name to connect from.
|
java.lang.String |
getClientId()
Gets the client identifier used to authenticate.
|
org.apache.commons.pool.impl.GenericObjectPool.Config |
getConfig()
Gets the configuration for the
GenericObjectPool . |
EPPSessionPoolableFactory |
getFactory()
Gets the factory associated with the pool.
|
org.apache.commons.pool.impl.GenericObjectPool |
getGenericObjectPool()
Gets the contained
GenericObjectPool . |
org.apache.commons.pool.impl.GenericObjectPool |
getGenericObjectPool(java.lang.String aSystem)
Gets the contained
GenericObjectPool for a system. |
long |
getIdleTimeout()
Gets the session idle timeout.
|
static EPPSessionPool |
getInstance()
Gets the Singleton Design Pattern instance.
|
java.lang.String |
getPassword()
Gets the password used for authentication.
|
java.lang.String |
getServerName()
Gets the TCP server IP address or host name, or the URL of the HTTP
server.
|
java.lang.Integer |
getServerPort()
Gets the TCP server port number.
|
EPPSystemSessionPool |
getSystemSessionPool(java.lang.String aSystem)
Gets the contained
EPPSystemSessionPool for a system. |
boolean |
hasSystemSessionPool(java.lang.String aSystem)
Does the system session pool exist?
|
void |
init() |
void |
init(EPPSessionPoolableFactory aFactory,
org.apache.commons.pool.impl.GenericObjectPool.Config aConfig)
Initialize the pool with a specific
EPPSessionPoolableFactory
and GenericObjectPool.Config setting. |
void |
invalidateObject(EPPSession aSession)
Remove a borrowed session from the pool based on a known issue with it.
|
void |
invalidateObject(java.lang.String aSystem,
EPPSession aSession)
Remove a borrowed session from the system session pool based on a known
issue with it.
|
void |
returnObject(EPPSession aSession)
Returned a borrowed session to the pool.
|
void |
returnObject(java.lang.String aSystem,
EPPSession aSession)
Returned a borrowed session to a system session pool.
|
void |
setClientHost(java.lang.String aClientHost)
Sets the TCP server IP address or host name to connect from.
|
void |
setServerName(java.lang.String aServerName)
Sets the TCP server IP address or host name or the URL of the HTTP server.
|
void |
setServerPort(java.lang.Integer aServerPort)
Sets the TCP server port number.
|
public static final long DEFAULT_ABSOLUTE_TIMEOUT
public static final long DEFAULT_IDLE_TIMEOUT
public static final long DEFAULT_MAX_WAIT
borrowObject()
method should block before throwing an exception.public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
public static final int DEFAULT_MAX_IDLE
public static final int DEFAULT_MAX_ACTIVE
public static final int DEFAULT_MIN_IDLE
protected static EPPSessionPool instance
public static final java.lang.String DEFAULT
borrowObject()
, returnObject(EPPSession)
, and
invalidateObject(EPPSession)
.protected EPPSessionPool()
public static EPPSessionPool getInstance()
init()
is called at least once.public void init(EPPSessionPoolableFactory aFactory, org.apache.commons.pool.impl.GenericObjectPool.Config aConfig)
EPPSessionPoolableFactory
and GenericObjectPool.Config
setting.aFactory
- EPP session poolable object factoryaConfig
- Configuration attributes for poolpublic void init() throws EPPSessionPoolException
EPPSessionPoolException
public void close()
EPPSessionPool
cleanly. Cleanly closing the session pools means clearing the pools that
will execute an EPP logout for each of the idle sessions and close the
pool.public EPPSession borrowObject() throws EPPSessionPoolException
invalidateObject(com.verisign.epp.interfaces.EPPSession)
or returnObject(com.verisign.epp.interfaces.EPPSession)
. This
method will block if there are no idle sessions in the pool for
maxWait
time.EPPSession
instance.EPPSessionPoolException
- On errorpublic EPPSession borrowObject(java.lang.String aSystem) throws EPPSessionPoolException
invalidateObject(com.verisign.epp.interfaces.EPPSession)
or returnObject(com.verisign.epp.interfaces.EPPSession)
. This
method will block if there are no idle sessions in the pool for
maxWait
time.EPPSession
instance.EPPSessionPoolException
- On errorpublic void invalidateObject(EPPSession aSession) throws EPPSessionPoolException
aSession
- Session that is invalidEPPSessionPoolException
- On errorpublic void invalidateObject(java.lang.String aSystem, EPPSession aSession) throws EPPSessionPoolException
aSystem
- the system nameaSession
- Session that is invalidEPPSessionPoolException
- On errorpublic void returnObject(EPPSession aSession) throws EPPSessionPoolException
borrowObject()
.aSession
- Session to returnEPPSessionPoolException
- On errorpublic void returnObject(java.lang.String aSystem, EPPSession aSession) throws EPPSessionPoolException
borrowObject(String)
.aSystem
- the system nameaSession
- Session to returnEPPSessionPoolException
- On errorpublic org.apache.commons.pool.impl.GenericObjectPool getGenericObjectPool()
GenericObjectPool
.GenericObjectPool
if defined;
null
otherwise.public boolean hasSystemSessionPool(java.lang.String aSystem)
aSystem
- System session pool name to findtrue
if the system session pool exists;
false
otherwise.public EPPSystemSessionPool getSystemSessionPool(java.lang.String aSystem) throws EPPSessionPoolException
EPPSystemSessionPool
for a system.aSystem
- System name for poolEPPSystemSessionPool
.EPPSessionPoolException
- When system pool can not be foundpublic org.apache.commons.pool.impl.GenericObjectPool getGenericObjectPool(java.lang.String aSystem) throws EPPSessionPoolException
GenericObjectPool
for a system.aSystem
- System name for poolGenericObjectPool
.EPPSessionPoolException
- When system pool can not be foundpublic long getAbsoluteTimeout()
public java.lang.String getClientId()
public org.apache.commons.pool.impl.GenericObjectPool.Config getConfig()
GenericObjectPool
.public EPPSessionPoolableFactory getFactory()
public long getIdleTimeout()
public java.lang.String getPassword()
public java.lang.String getServerName()
public void setServerName(java.lang.String aServerName)
aServerName
- Server host name, IP address, or URLpublic java.lang.Integer getServerPort()
null
if
connecting to a HTTP server.null
otherwise.public void setServerPort(java.lang.Integer aServerPort)
aServerPort
- TCP server port numberpublic java.lang.String getClientHost()
null
value will use the loop back.null
otherwise.public void setClientHost(java.lang.String aClientHost)
null
value will use the loop back.aClientHost
- Client host name or IP addressCopyright © VeriSign Inc. All Rights Reserved.