com.ca.jcs.jndi
Class JNDIConnectionFactory
java.lang.Object
org.apache.commons.pool.BasePoolableObjectFactory
com.ca.jcs.jndi.JNDIConnectionFactory
- All Implemented Interfaces:
- PoolableObjectFactory
- Direct Known Subclasses:
- JNDIKerberosConnectionFactory
public class JNDIConnectionFactory
- extends BasePoolableObjectFactory
Generic factory which can assist in management of a pool of JNDI connections (InitialDirContexts)
based provided configuration jndiEnv.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
jndiEnv
protected final Properties jndiEnv
JNDIConnectionFactory
public JNDIConnectionFactory(Properties jndiEnv)
- Remember settings which will be used to allocate future connections, where at least these fields
must be included for connections to be established:
Context.PROVIDER_URL
Context.INITIAL_CONTEXT_FACTORY
Context.SECURITY_AUTHENTICATION
Context.SECURITY_PRINCIPAL
Context.SECURITY_CREDENTIALS
- Parameters:
jndiEnv - Environment to be used in establishing future connections.
makeObject
public Object makeObject()
throws Exception
- Specified by:
makeObject in interface PoolableObjectFactory- Specified by:
makeObject in class BasePoolableObjectFactory
- Returns:
- Created secure or normal JNDI connection instance (InitialContext) that can be used by the pool.
- Throws:
Exception
destroyObject
public void destroyObject(Object object)
throws Exception
- Disconnect all services for an instance in the pool, as it is being removed from it.
- Specified by:
destroyObject in interface PoolableObjectFactory- Overrides:
destroyObject in class BasePoolableObjectFactory
- Parameters:
object - the instance to be destroyed
- Throws:
Exception
Created 2011-07-14 13:27 EST