クラス PooledContextSource

実装済みのインターフェース一覧:
org.springframework.beans.factory.DisposableBean, ContextSource, BaseLdapPathSource
既知の直属サブクラス
MutablePooledContextSource

public class PooledContextSource extends DelegatingBaseLdapPathContextSourceSupport implements ContextSource, org.springframework.beans.factory.DisposableBean
オブジェクトプールと別の ContextSource をラップする ContextSource 実装。DirContextSE は、維持するプールから取得されます。注: この実装は、apache commons-pool2 に基づいています。

構成:
プロパティ 説明 必須 デフォルト
contextSource プールに追加するために DirContextSE を取得する ContextSource。 はい null
dirContextValidatorDirContextSE の検証に使用する DirContextValidator。テスト / 検証オプションのいずれかが有効になっている場合は必須です。 いいえ null
poolConfig プールを構成するための PoolConfig。 いいえ null
導入:
2.0
  • フィールドの詳細

    • logger

      protected final org.slf4j.Logger logger
      The logger for this class and sub-classes.
    • keyedObjectPool

      protected final org.apache.commons.pool2.impl.GenericKeyedObjectPool<ObjectSE,ObjectSE> keyedObjectPool
  • コンストラクターの詳細

    • PooledContextSource

      @DeprecatedSE public PooledContextSource(@Nullable PoolConfig poolConfig)
      使用すべきではありません。
      コンストラクターに ContextSource を指定してください
      新しいプーリングコンテキストソースを作成し、DirContext オブジェクトファクトリと汎用のキー付きオブジェクトプールを設定します。
    • PooledContextSource

      public PooledContextSource(ContextSource contextSource, @Nullable PoolConfig poolConfig)
      新しいプーリングコンテキストソースを作成し、DirContext オブジェクトファクトリと汎用のキー付きオブジェクトプールを設定します。
      導入:
      4.1
  • 方法の詳細

    • getPoolConfig

      public PoolConfig getPoolConfig()
      Get the pool configuration.
      戻り値:
      poolConfig
    • getNumIdle

      public int getNumIdle()
      Get the number of instances currently idle in this pool.
      関連事項:
      • GenericKeyedObjectPool.getNumIdle()
    • getNumIdleRead

      public int getNumIdleRead()
      Get the number of instances currently idle in this pool for the read-only key.
      関連事項:
      • GenericKeyedObjectPool.getNumIdle(Object)
    • getNumIdleWrite

      public int getNumIdleWrite()
      Get the number of instances currently idle in this pool for the read-write key.
      関連事項:
      • GenericKeyedObjectPool.getNumIdle(Object)
    • getNumActive

      public int getNumActive()
      Get the number of instances currently borrowed from this pool.
      関連事項:
      • GenericKeyedObjectPool.getNumActive()
    • getNumActiveRead

      public int getNumActiveRead()
      Get the number of instances currently borrowed from this pool for the read-only key.
      関連事項:
      • GenericKeyedObjectPool.getNumActive(Object)
    • getNumActiveWrite

      public int getNumActiveWrite()
      Get the number of instances currently borrowed from this pool for the read-write key.
      関連事項:
      • GenericKeyedObjectPool.getNumActive(Object)
    • getNumWaiters

      public int getNumWaiters()
      Get the number of threads currently waiting for an instance from this pool.
      関連事項:
      • GenericKeyedObjectPool.getNumWaiters()
    • getContextSource

      public ContextSource getContextSource()
      Get the context source used to create pooled contexts.
      戻り値:
      contextSource
    • getDirContextValidator

      public DirContextValidator getDirContextValidator()
      Get the validator used to validate pooled contexts.
      戻り値:
      dirContextValidator
    • setContextSource

      @DeprecatedSE public void setContextSource(ContextSource contextSource)
      使用すべきではありません。
      コンストラクターに基となる ContextSource を指定してください
      Set the context source used to create pooled contexts.
      パラメーター:
      contextSource - contextSource を設定するには必須
    • setDirContextValidator

      public void setDirContextValidator(DirContextValidator dirContextValidator)
      Set the validator used to validate pooled contexts.
      パラメーター:
      dirContextValidator - dirContextValidator を設定するには必須
    • setNonTransientExceptions

      public void setNonTransientExceptions(CollectionSE<ClassSE<? extends ThrowableSE>> nonTransientExceptions)
      積極的なコンテキストの無効化に関して非一時的であると解釈される例外クラスを構成します。構成された例外 (またはそのサブクラス) の 1 つがプールされた DirContext のメソッドによってスローされた場合、そのインスタンスは追加のテスト (つまり、testOnReturn) なしですぐに無効としてマークされます。これにより、無効な接続をより効率的に管理できます。デフォルトは CommunicationExceptionSE です。
      パラメーター:
      nonTransientExceptions - 積極的な無効化に関して非一時的であると解釈されるべき例外クラス。
      導入:
      2.0
    • destroy

      public void destroy() throws ExceptionSE
      次で指定:
      インターフェース org.springframework.beans.factory.DisposableBean 内の destroy 
      例外:
      ExceptionSE
    • getTarget

      protected ContextSource getTarget()
      クラスからコピーされた説明: DelegatingBaseLdapPathContextSourceSupport
      ターゲット ContextSource を取得します。
      次で指定:
      クラス DelegatingBaseLdapPathContextSourceSupport の getTarget 
      戻り値:
      対象の ContextSource。
    • getReadOnlyContext

      public DirContextSE getReadOnlyContext()
      インターフェースからコピーされた説明: ContextSource
      読み取り専用の DirContext を取得します。返された DirContext は、読み取り専用操作を実行できる必要があります。
      次で指定:
      インターフェース ContextSource 内の getReadOnlyContext 
      戻り値:
      DirContext インスタンスで、null になることはありません。
    • getReadWriteContext

      public DirContextSE getReadWriteContext()
      インターフェースからコピーされた説明: ContextSource
      読み取り / 書き込み DirContext インスタンスを取得します。
      次で指定:
      インターフェース ContextSource 内の getReadWriteContext 
      戻り値:
      DirContext インスタンスであり、null ではありません。
    • getContext

      protected DirContextSE getContext(DirContextType dirContextType)
      キー付きオブジェクトプールから、指定された型の DirContext を取得します。
      パラメーター:
      dirContextType - 返すコンテキストの型。
      戻り値:
      指定された型のラップされた DirContext。
      例外:
      org.springframework.dao.DataAccessResourceFailureException - プールからオブジェクトを取得すると例外がスローされる場合
    • getContext

      public DirContextSE getContext(StringSE principal, StringSE credentials)
      インターフェースからコピーされた説明: ContextSource
      提供されたプリンシパルと資格情報を使用して認証された DirContext インスタンスを取得します。通常、プレーン認証の目的で使用されます。このインスタンスはネイティブ Java LDAP プーリングを使用するように構成されていますが、このメソッドは決してネイティブ Java LDAP プーリングを使用しないことに注意してください。これは、ターゲットディレクトリでのパスワードの変更をできるだけ早く有効にするためです。
      次で指定:
      インターフェース ContextSource 内の getContext 
      パラメーター:
      principal - 認証に使用するプリンシパル (通常は LDAP ツリー内のユーザーの識別名)。
      credentials - 認証に使用する資格情報。
      戻り値:
      認証された DirContext インスタンスであり、null ではありません。