クラス PooledContextSource

実装されているすべてのインターフェース:
org.springframework.beans.factory.DisposableBeanContextSourceBaseLdapPathSource
既知の直属サブクラス
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
      このクラスとサブクラスのロガー
    • keyedObjectPool

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

    • PooledContextSource

      public PooledContextSource(PoolConfig poolConfig)
      新しいプーリングコンテキストソースを作成し、DirContext オブジェクトファクトリと汎用のキー付きオブジェクトプールを設定します。
  • メソッドの詳細

    • getPoolConfig

      public PoolConfig getPoolConfig()
      戻り値:
      poolConfig
    • getNumIdle

      public int getNumIdle()
      関連事項:
      • GenericKeyedObjectPool.getNumIdle()
    • getNumIdleRead

      public int getNumIdleRead()
      関連事項:
      • GenericKeyedObjectPool.getNumIdle(Object)
    • getNumIdleWrite

      public int getNumIdleWrite()
      関連事項:
      • GenericKeyedObjectPool.getNumIdle(Object)
    • getNumActive

      public int getNumActive()
      関連事項:
      • GenericKeyedObjectPool.getNumActive()
    • getNumActiveRead

      public int getNumActiveRead()
      関連事項:
      • GenericKeyedObjectPool.getNumActive(Object)
    • getNumActiveWrite

      public int getNumActiveWrite()
      関連事項:
      • GenericKeyedObjectPool.getNumActive(Object)
    • getNumWaiters

      public int getNumWaiters()
      関連事項:
      • GenericKeyedObjectPool.getNumWaiters()
    • getContextSource

      public ContextSource getContextSource()
      戻り値:
      contextSource
    • getDirContextValidator

      public DirContextValidator getDirContextValidator()
      戻り値:
      dirContextValidator
    • setContextSource

      public void setContextSource(ContextSource contextSource)
      パラメーター:
      contextSource - contextSource を設定するには必須
    • setDirContextValidator

      public void setDirContextValidator(DirContextValidator dirContextValidator)
      パラメーター:
      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.DisposableBeandestroy 
      例外:
      ExceptionSE
    • getTarget

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

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

      public DirContextSE getReadWriteContext()
      インターフェースからコピーされた説明: ContextSource
      読み取り / 書き込み DirContext インスタンスを取得します。
      次で指定:
      インターフェース ContextSourcegetReadWriteContext 
      戻り値:
      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 プーリングを使用しないことに注意してください。これは、ターゲットディレクトリでのパスワードの変更をできるだけ早く有効にするためです。
      次で指定:
      インターフェース ContextSourcegetContext 
      パラメーター:
      principal - 認証に使用するプリンシパル (通常は LDAP ツリー内のユーザーの識別名)。
      credentials - 認証に使用する資格情報。
      戻り値:
      認証された DirContext インスタンスであり、null ではありません。