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
|
private static org.slf4j.Logger |
LOG
This class logger
|
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.
|
org.apache.directory.api.ldap.codec.api.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.
|
private static final org.slf4j.Logger LOG
protected LdapConnectionFactory connectionFactory
protected LdapConnectionValidator validator
public AbstractPoolableLdapConnectionFactory()
public void activateObject(LdapConnection connection) throws org.apache.directory.api.ldap.model.exception.LdapException
activateObject in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>org.apache.directory.api.ldap.model.exception.LdapExceptionpublic void destroyObject(LdapConnection connection) throws org.apache.directory.api.ldap.model.exception.LdapException
destroyObject in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>org.apache.directory.api.ldap.model.exception.LdapExceptionpublic org.apache.directory.api.ldap.codec.api.LdapApiService getLdapApiService()
public LdapConnection makeObject() throws org.apache.directory.api.ldap.model.exception.LdapException
makeObject in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>org.apache.directory.api.ldap.model.exception.LdapException - If unable to connect.protected static LdapConnectionFactory newLdapConnectionFactory(LdapConnectionConfig config, Class<? extends LdapConnectionFactory> connectionFactoryClass)
public void passivateObject(LdapConnection connection) throws org.apache.directory.api.ldap.model.exception.LdapException
passivateObject in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>org.apache.directory.api.ldap.model.exception.LdapException - If unable to reconfigure and rebind.public void setValidator(LdapConnectionValidator validator)
setTestOnBorrowsetTestWhileIdlesetTestOnReturnLookupLdapConnectionValidator.validator - The validatorpublic boolean validateObject(LdapConnection connection)
validateObject in interface org.apache.commons.pool.PoolableObjectFactory<LdapConnection>Copyright © 2009–2017 The Apache Software Foundation. All rights reserved.