|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.service.resourcepool.ResourcePool
atg.service.resourcepool.JNDIInitialContextPool
public class JNDIInitialContextPool
A pool of JNDI InitialContext objects. The createDirContexts property indicates whether the objects in the pool should be of type InitialDirContext or simply InitialContext.
An InitialContext pool is useful in those cases when a connection to the JNDI service provider is expensive to establish. For example, if JNDI is used to connect to an LDAP directory service provider, creating an InitialContext automatically establishes a connection to the LDAP server, a potentially expensive operation. In such cases, using a JNDIInitialContextPool to manage connections to the JNDI service provider is analogous to using the JDBCConnectionPool for database access.
Note that any JNDI Context and NamingEnumeration objects obtained from an InitialContext share the InitialContext's connection to the service provider. Thus, after the InitialContext has been used and checked back in to the pool, one must be careful not to continue using any associated Context or NamingEnumeration objects.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.service.resourcepool.ResourcePool |
---|
mBlocking, mCheckoutBlockTime, mCreatingResources, mCreationTimeLimit, mFreeResources, mHealthy, mMax, mMaxFree, mMaxPendingCreations, mMaxStartupAttempts, mMin, mPool, mResourceClassName, mStartupSleepTime, mUnusedPoolSlots |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.service.resourcepool.ResourcePoolResourceKeys |
---|
RESOURCE_BUNDLE, RSRC_blockTimeout, RSRC_ciCreateFailure, RSRC_ciForeignResource, RSRC_ciWrongResource, RSRC_coNonRunning, RSRC_creationLimit, RSRC_creationTimeout, RSRC_failedInitialPopulation, RSRC_hitPoolMax, RSRC_maxResourcePerThread, RSRC_maxThreads, RSRC_misconfiguration, RSRC_nestedCheckout, RSRC_nonOwningThread, RSRC_notImplemented, RSRC_poolDisabled, RSRC_startupFailure, RSRC_usingClosedConnection |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
JNDIInitialContextPool()
|
Method Summary | |
---|---|
ResourceObject |
checkOut(java.lang.String pCheckOutTag)
Checks a resource out of the pool. |
java.lang.Object |
createResource()
Creates a new resource object for the pool. |
void |
destroyResource(java.lang.Object pResource)
Destroys a resource object of this pool. |
boolean |
getCreateDirContexts()
Returns true if the resource pool objects should be of type InitialDirContext, false if InitialContext. |
boolean |
getCreateMonitoredContexts()
Returns true if the resource pool InitialContext (or InitialDirContext) objects should be wrapped in MonitoredContext (or MonitoredDirContext) objects, false otherwise. |
java.util.Hashtable |
getJNDIEnvironment()
Returns a JNDI environment which can be used to construct an instance of InitialContext (or InitialDirContext). |
java.lang.Object |
lookupUsingPool(java.lang.String pCallerName,
java.lang.String pName)
Lookup the name using the pool, if possible. |
void |
setCreateDirContexts(boolean pCreateDirContexts)
Sets whether the resource pool objects should be of type InitialDirContext (true) or InitialContext (false). |
void |
setCreateMonitoredContexts(boolean pCreateMonitoredContexts)
Sets whether the resource pool InitialContext (or InitialDirContext) objects should be wrapped in MonitoredContext (or MonitoredDirContext) objects. |
void |
setJNDIEnvironment(java.util.Hashtable pJNDIEnvironment)
Sets the JNDI environment copies of which will be used to construct instances of InitialContext (or InitialDirContext). |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public JNDIInitialContextPool()
Method Detail |
---|
public java.util.Hashtable getJNDIEnvironment()
public void setJNDIEnvironment(java.util.Hashtable pJNDIEnvironment)
public boolean getCreateDirContexts()
public void setCreateDirContexts(boolean pCreateDirContexts)
public boolean getCreateMonitoredContexts()
public void setCreateMonitoredContexts(boolean pCreateMonitoredContexts)
public java.lang.Object createResource() throws ResourcePoolException
createResource
in class ResourcePool
ResourcePoolException
- if there was a problem creating
the resourcepublic void destroyResource(java.lang.Object pResource)
destroyResource
in class ResourcePool
pResource
- the Object to destroypublic ResourceObject checkOut(java.lang.String pCheckOutTag) throws ResourcePoolException
checkOut
in class ResourcePool
ResourcePoolException
- if an error occurred during the
operationpublic java.lang.Object lookupUsingPool(java.lang.String pCallerName, java.lang.String pName) throws javax.naming.NamingException
javax.naming.NamingException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |