Package org.ldaptive
Class PooledConnectionFactory
java.lang.Object
org.ldaptive.pool.AbstractConnectionPool
org.ldaptive.pool.BlockingConnectionPool
org.ldaptive.PooledConnectionFactory
- All Implemented Interfaces:
ConnectionFactory
,ConnectionPool
Creates connections for performing ldap operations and manages those connections as a pool.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
class
Validation exception handler that attempts to retrieve another connection.Nested classes/interfaces inherited from class org.ldaptive.pool.AbstractConnectionPool
AbstractConnectionPool.DefaultPooledConnectionProxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ValidationExceptionHandler
Validation exception handler.Fields inherited from class org.ldaptive.pool.AbstractConnectionPool
active, available, checkOutLock, DEFAULT_MAX_POOL_SIZE, DEFAULT_MIN_POOL_SIZE, logger, poolLock, poolNotEmpty
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PooledConnectionFactory
(String ldapUrl) Creates a new pooled connection factory.PooledConnectionFactory
(String ldapUrl, Transport t) Creates a new pooled connection factory.Creates a new pooled connection factory.Creates a new pooled connection factory.Creates a new pooled connection factory. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder for this class.Creates a builder for this class.void
close()
Empty this pool, freeing any resources.Returns a connection from the pool.Returns the connection configuration used to create connections.Returns the ldap transport.Returns the validation exception handler.void
Sets the connection config.void
Sets the validation exception handler.toString()
Methods inherited from class org.ldaptive.pool.BlockingConnectionPool
blockAvailableConnection, getBlockWaitTime, putConnection, retrieveAvailableConnection, setBlockWaitTime
Methods inherited from class org.ldaptive.pool.AbstractConnectionPool
activateAndValidateConnection, activeCount, availableCount, createActiveConnection, createAvailableConnection, createConnection, createConnectionProxy, getActivator, getConnectOnCreate, getDefaultConnectionFactory, getFailFastInitialize, getMaxPoolSize, getMinPoolSize, getName, getPassivator, getPooledConnectionStatistics, getPruneStrategy, getQueueType, getValidator, grow, grow, initialize, isInitialized, isValidateOnCheckIn, isValidateOnCheckOut, isValidatePeriodically, passivateAndValidateConnection, prune, removeActiveConnection, removeAvailableAndActiveConnection, removeAvailableConnection, retrieveConnectionProxy, setActivator, setConnectOnCreate, setDefaultConnectionFactory, setFailFastInitialize, setMaxPoolSize, setMinPoolSize, setName, setPassivator, setPruneStrategy, setQueueType, setValidateOnCheckIn, setValidateOnCheckOut, setValidatePeriodically, setValidator, throwIfNotInitialized, validate, validateAndPassivateConnection
-
Field Details
-
validationExceptionHandler
Validation exception handler. Default implementation retries once.
-
-
Constructor Details
-
PooledConnectionFactory
public PooledConnectionFactory()Default constructor. -
PooledConnectionFactory
Creates a new pooled connection factory.- Parameters:
t
- transport
-
PooledConnectionFactory
Creates a new pooled connection factory.- Parameters:
ldapUrl
- to connect to
-
PooledConnectionFactory
Creates a new pooled connection factory.- Parameters:
ldapUrl
- to connect tot
- transport
-
PooledConnectionFactory
Creates a new pooled connection factory.- Parameters:
cc
- connection configuration
-
PooledConnectionFactory
Creates a new pooled connection factory.- Parameters:
cc
- connection configurationt
- transport
-
-
Method Details
-
getConnectionConfig
Description copied from interface:ConnectionFactory
Returns the connection configuration used to create connections.- Specified by:
getConnectionConfig
in interfaceConnectionFactory
- Returns:
- connection config
-
setConnectionConfig
Sets the connection config. Once invoked the supplied connection config is made immutable. SeeAbstractConfig.makeImmutable()
.- Parameters:
cc
- connection config
-
getValidationExceptionHandler
Returns the validation exception handler.- Returns:
- validation exception handler
-
setValidationExceptionHandler
Sets the validation exception handler.- Parameters:
handler
- validation exception handler
-
getTransport
Returns the ldap transport.- Returns:
- ldap transport
-
getConnection
Description copied from class:AbstractConnectionPool
Returns a connection from the pool.- Specified by:
getConnection
in interfaceConnectionFactory
- Specified by:
getConnection
in interfaceConnectionPool
- Overrides:
getConnection
in classBlockingConnectionPool
- Returns:
- connection
- Throws:
PoolException
- if this operation fails
-
close
public void close()Description copied from class:AbstractConnectionPool
Empty this pool, freeing any resources.- Specified by:
close
in interfaceConnectionFactory
- Specified by:
close
in interfaceConnectionPool
- Overrides:
close
in classAbstractConnectionPool
-
toString
- Overrides:
toString
in classBlockingConnectionPool
-
builder
Creates a builder for this class.- Returns:
- new builder
-
builder
Creates a builder for this class.- Parameters:
t
- transport- Returns:
- new builder
-