public abstract class AbstractPoolableLdapConnectionFactory extends Object implements org.apache.commons.pool.PoolableObjectFactory<LdapConnection>
Modifier and Type | Field and Description |
---|---|
protected LdapConnectionFactory |
connectionFactory
The factory to use to create a new connection
|
protected LdapConnectionValidator |
validator
The validator to use
|
Constructor and Description |
---|
AbstractPoolableLdapConnectionFactory() |
Modifier and Type | Method and Description |
---|---|
void |
activateObject(LdapConnection connection)
There is nothing to do to activate a connection.
|
void |
destroyObject(LdapConnection connection)
Destroying a connection will unbind it which will result on a shutdown
of teh underlying protocol.
|
LdapApiService |
getLdapApiService()
Returns the LdapApiService instance used by this factory.
|
LdapConnection |
makeObject()
Specifically, we are creating a new connection based on the LdapConnection Factory
we used to create this pool of connections.
|
protected static LdapConnectionFactory |
newLdapConnectionFactory(LdapConnectionConfig config,
Class<? extends LdapConnectionFactory> connectionFactoryClass) |
void |
passivateObject(LdapConnection connection)
We don't do anything with the connection.
|
void |
setValidator(LdapConnectionValidator validator)
Sets the validator to use when validation occurs.
|
boolean |
validateObject(LdapConnection connection)
Validating a connection is done by checking the connection status.
|
protected LdapConnectionFactory connectionFactory
protected LdapConnectionValidator validator
public AbstractPoolableLdapConnectionFactory()
public void activateObject(LdapConnection connection) throws LdapException
activateObject
in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>
LdapException
public void destroyObject(LdapConnection connection) throws LdapException
destroyObject
in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>
LdapException
public LdapApiService getLdapApiService()
public LdapConnection makeObject() throws LdapException
makeObject
in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>
LdapException
- If unable to connect.protected static LdapConnectionFactory newLdapConnectionFactory(LdapConnectionConfig config, Class<? extends LdapConnectionFactory> connectionFactoryClass)
public void passivateObject(LdapConnection connection) throws LdapException
passivateObject
in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>
LdapException
- If unable to reconfigure and rebind.public void setValidator(LdapConnectionValidator validator)
setTestOnBorrow
setTestWhileIdle
setTestOnReturn
LookupLdapConnectionValidator
.validator
- The validatorpublic boolean validateObject(LdapConnection connection)
validateObject
in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>
Copyright © 2003–2015 The Apache Software Foundation. All rights reserved.