org.springframework.ldap.pool2.factory

## Class MutablePooledContextSource

- java.lang.Object
- - org.springframework.ldap.core.support.DelegatingBaseLdapPathContextSourceSupport
  - - org.springframework.ldap.pool2.factory.PooledContextSource
    - - org.springframework.ldap.pool2.factory.MutablePooledContextSource

- All Implemented Interfaces:
    DisposableBean, ContextSource, BaseLdapPathSource

      public class MutablePooledContextSource
      extends PooledContextSource

  A `PooledContextSource` subclass that creates `MutableDelegatingLdapContext` instances. This enables the Spring LDAP pooling to be used in scenarios that require request controls to be set, such as paged results.
  Since:
    2.0
  Author:
    Anindya Chatterjee

- - ### Field Summary

    - ### Fields inherited from class org.springframework.ldap.pool2.factory.PooledContextSource

      `keyedObjectPool, logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MutablePooledContextSource(PoolConfig poolConfig)` Creates a new pooling context source, setting up the DirContext object factory and generic keyed object pool.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected DirContext` | `getContext(DirContextType dirContextType)` Gets a DirContext of the specified type from the keyed object pool.

    - ### Methods inherited from class org.springframework.ldap.pool2.factory.PooledContextSource

      `destroy, getContext, getContextSource, getDirContextValidator, getNumActive, getNumActiveRead, getNumActiveWrite, getNumIdle, getNumIdleRead, getNumIdleWrite, getNumWaiters, getPoolConfig, getReadOnlyContext, getReadWriteContext, getTarget, setContextSource, setDirContextValidator, setNonTransientExceptions`

    - ### Methods inherited from class org.springframework.ldap.core.support.DelegatingBaseLdapPathContextSourceSupport

      `getBaseLdapName, getBaseLdapPath, getBaseLdapPathAsString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MutablePooledContextSource

          public MutablePooledContextSource(PoolConfig poolConfig)

      Creates a new pooling context source, setting up the DirContext object factory and generic keyed object pool.
      Parameters:
        `poolConfig` - pool configurations to set.

  - ### Method Detail

    - #### getContext

          protected DirContext getContext(DirContextType dirContextType)

      Description copied from class: `PooledContextSource`
      Gets a DirContext of the specified type from the keyed object pool.
      Overrides:
        `getContext` in class `PooledContextSource`
      Parameters:
        `dirContextType` - The type of context to return.
      Returns:
        A wrapped DirContext of the specified type.