クラス PooledContextSource
java.lang.ObjectSE
org.springframework.ldap.core.support.DelegatingBaseLdapPathContextSourceSupport
org.springframework.ldap.pool2.factory.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 |
| dirContextValidator | DirContextSE の検証に使用する DirContextValidator。テスト / 検証オプションのいずれかが有効になっている場合は必須です。 | いいえ | null |
| poolConfig | プールを構成するための PoolConfig。 | いいえ | null |
- 導入:
- 2.0
フィールド概要
フィールド修飾子と型フィールド説明protected final org.slf4j.LoggerThe logger for this class and sub-classes.コンストラクター概要
コンストラクターコンストラクター説明PooledContextSource(ContextSource contextSource, @Nullable PoolConfig poolConfig) 新しいプーリングコンテキストソースを作成し、DirContext オブジェクトファクトリと汎用のキー付きオブジェクトプールを設定します。PooledContextSource(@Nullable PoolConfig poolConfig) 使用すべきではありません。方法の概要
修飾子と型メソッド説明voiddestroy()getContext(StringSE principal, StringSE credentials) 提供されたプリンシパルと資格情報を使用して認証されたDirContextインスタンスを取得します。protected DirContextSEgetContext(DirContextType dirContextType) キー付きオブジェクトプールから、指定された型の DirContext を取得します。Get the context source used to create pooled contexts.Get the validator used to validate pooled contexts.intGet the number of instances currently borrowed from this pool.intGet the number of instances currently borrowed from this pool for the read-only key.intGet the number of instances currently borrowed from this pool for the read-write key.intGet the number of instances currently idle in this pool.intGet the number of instances currently idle in this pool for the read-only key.intGet the number of instances currently idle in this pool for the read-write key.intGet the number of threads currently waiting for an instance from this pool.Get the pool configuration.読み取り専用のDirContextを取得します。読み取り / 書き込みDirContextインスタンスを取得します。protected ContextSourceターゲット ContextSource を取得します。voidsetContextSource(ContextSource contextSource) 使用すべきではありません。コンストラクターに基となるContextSourceを指定してくださいvoidsetDirContextValidator(DirContextValidator dirContextValidator) Set the validator used to validate pooled contexts.voidsetNonTransientExceptions(CollectionSE<ClassSE<? extends ThrowableSE>> nonTransientExceptions) 積極的なコンテキストの無効化に関して非一時的であると解釈される例外クラスを構成します。
フィールドの詳細
logger
protected final org.slf4j.Logger loggerThe logger for this class and sub-classes.keyedObjectPool
コンストラクターの詳細
PooledContextSource
使用すべきではありません。コンストラクターにContextSourceを指定してください新しいプーリングコンテキストソースを作成し、DirContext オブジェクトファクトリと汎用のキー付きオブジェクトプールを設定します。PooledContextSource
新しいプーリングコンテキストソースを作成し、DirContext オブジェクトファクトリと汎用のキー付きオブジェクトプールを設定します。- 導入:
- 4.1
方法の詳細
getPoolConfig
getNumIdle
public int getNumIdle()Get the number of instances currently idle in this pool.- 関連事項:
getNumIdleRead
public int getNumIdleRead()Get the number of instances currently idle in this pool for the read-only key.- 関連事項:
getNumIdleWrite
public int getNumIdleWrite()Get the number of instances currently idle in this pool for the read-write key.- 関連事項:
getNumActive
public int getNumActive()Get the number of instances currently borrowed from this pool.- 関連事項:
getNumActiveRead
public int getNumActiveRead()Get the number of instances currently borrowed from this pool for the read-only key.- 関連事項:
getNumActiveWrite
public int getNumActiveWrite()Get the number of instances currently borrowed from this pool for the read-write key.- 関連事項:
getNumWaiters
public int getNumWaiters()Get the number of threads currently waiting for an instance from this pool.- 関連事項:
getContextSource
Get the context source used to create pooled contexts.- 戻り値:
- contextSource
getDirContextValidator
Get the validator used to validate pooled contexts.- 戻り値:
- dirContextValidator
setContextSource
使用すべきではありません。コンストラクターに基となるContextSourceを指定してくださいSet the context source used to create pooled contexts.- パラメーター:
contextSource- contextSource を設定するには必須
setDirContextValidator
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
- 次で指定:
- インターフェース
org.springframework.beans.factory.DisposableBean内のdestroy - 例外:
ExceptionSE
getTarget
クラスからコピーされた説明:DelegatingBaseLdapPathContextSourceSupportターゲット ContextSource を取得します。- 次で指定:
- クラス
DelegatingBaseLdapPathContextSourceSupportのgetTarget - 戻り値:
- 対象の ContextSource。
getReadOnlyContext
インターフェースからコピーされた説明:ContextSource読み取り専用のDirContextを取得します。返されたDirContextは、読み取り専用操作を実行できる必要があります。- 次で指定:
- インターフェース
ContextSource内のgetReadOnlyContext - 戻り値:
- DirContext インスタンスで、null になることはありません。
getReadWriteContext
インターフェースからコピーされた説明:ContextSource読み取り / 書き込みDirContextインスタンスを取得します。- 次で指定:
- インターフェース
ContextSource内のgetReadWriteContext - 戻り値:
DirContextインスタンスであり、nullではありません。
getContext
キー付きオブジェクトプールから、指定された型の DirContext を取得します。- パラメーター:
dirContextType- 返すコンテキストの型。- 戻り値:
- 指定された型のラップされた DirContext。
- 例外:
org.springframework.dao.DataAccessResourceFailureException- プールからオブジェクトを取得すると例外がスローされる場合
getContext
インターフェースからコピーされた説明:ContextSource提供されたプリンシパルと資格情報を使用して認証されたDirContextインスタンスを取得します。通常、プレーン認証の目的で使用されます。このインスタンスはネイティブ Java LDAP プーリングを使用するように構成されていますが、このメソッドは決してネイティブ Java LDAP プーリングを使用しないことに注意してください。これは、ターゲットディレクトリでのパスワードの変更をできるだけ早く有効にするためです。- 次で指定:
- インターフェース
ContextSource内のgetContext - パラメーター:
principal- 認証に使用するプリンシパル (通常は LDAP ツリー内のユーザーの識別名)。credentials- 認証に使用する資格情報。- 戻り値:
- 認証された
DirContextインスタンスであり、nullではありません。
ContextSourceを指定してください