パッケージ org.springframework.jndi
クラス JndiPropertySource
java.lang.ObjectSE
org.springframework.core.env.PropertySource<JndiLocatorDelegate>
org.springframework.jndi.JndiPropertySource
基になる Spring
JndiLocatorDelegate からプロパティを読み取る PropertySource 実装。 デフォルトでは、基礎となる JndiLocatorDelegate は、"resourceRef" プロパティが true に設定されて構成されます。つまり、検索された名前には、公開された JNDI 命名規則SEに合わせて "java:comp/env/" というプレフィックスが自動的に付けられます。この設定を上書きするか、プレフィックスを変更するには、JndiLocatorDelegate を手動で構成し、それを受け入れるコンストラクターの 1 つに提供します。カスタム JNDI プロパティを提供する場合も同じです。これらは、JndiPropertySource を構築する前に JndiAccessor.setJndiEnvironment(java.util.Properties) を使用して指定する必要があります。
StandardServletEnvironment にはデフォルトで JndiPropertySource が含まれており、基礎となる JndiLocatorDelegate のカスタマイズは ApplicationContextInitializer または WebApplicationInitializer 内で実行できることに注意してください。
- 導入:
- 3.1
- 作成者:
- Chris Beams, Juergen Hoeller
- 関連事項:
ネストされたクラスの要約
クラス org.springframework.core.env.PropertySource から継承されたネストクラス / インターフェース
PropertySource.StubPropertySourceフィールドのサマリー
クラス org.springframework.core.env.PropertySource から継承されたフィールド
logger, name, sourceコンストラクターの概要
コンストラクターコンストラクター説明JndiPropertySource(StringSE name) 指定された名前で新しいJndiPropertySourceを作成し、任意の名前の前に "java:comp/env/" を付けるように構成されたJndiLocatorDelegateを作成します。JndiPropertySource(StringSE name, JndiLocatorDelegate jndiLocator) 指定された名前と指定されたJndiLocatorDelegateで新しいJndiPropertySourceを作成します。メソッドのサマリー
修飾子と型メソッド説明getProperty(StringSE name) この実装は、基になるJndiLocatorDelegateから指定された名前に関連付けられた値を検索して返します。クラス org.springframework.core.env.PropertySource から継承されたメソッド
containsProperty, equals, getName, getSource, hashCode, named, toString
コンストラクターの詳細
JndiPropertySource
指定された名前で新しいJndiPropertySourceを作成し、任意の名前の前に "java:comp/env/" を付けるように構成されたJndiLocatorDelegateを作成します。JndiPropertySource
指定された名前と指定されたJndiLocatorDelegateで新しいJndiPropertySourceを作成します。
メソッドの詳細
getProperty
この実装は、基になるJndiLocatorDelegateから指定された名前に関連付けられた値を検索して返します。JndiLocatorDelegate.lookup(String)の呼び出し中にNamingExceptionSE がスローされた場合、nullを返し、例外メッセージを含む DEBUG レベルのログステートメントを発行します。- 次で指定:
- クラス
PropertySource<JndiLocatorDelegate>のgetProperty - パラメーター:
name- 検索するプロパティ- 関連事項: