クラス CachingDestinationResolverProxy<D>
java.lang.ObjectSE
org.springframework.messaging.core.CachingDestinationResolverProxy<D>
- 型パラメーター:
D
- 宛先型
- 実装されたすべてのインターフェース:
InitializingBean
,DestinationResolver<D>
public class CachingDestinationResolverProxy<D>
extends ObjectSE
implements DestinationResolver<D>, InitializingBean
ターゲット DestinationResolver をプロキシし、その
resolveDestination(java.lang.String)
結果をキャッシュする DestinationResolver
実装。このようなキャッシングは、宛先の解決プロセスにコストがかかり(たとえば、宛先が外部システムを通じて解決される必要がある場合)、解決結果がいずれにしても安定している場合に特に役立ちます。- 導入:
- 4.1
- 作成者:
- Agim Emruli, Juergen Hoeller
- 関連事項:
コンストラクターのサマリー
コンストラクター説明新しい CachingDestinationResolverProxy を作成し、setTargetDestinationResolver(org.springframework.messaging.core.DestinationResolver<D>)
Bean プロパティを介してターゲット DestinationResolver を設定します。CachingDestinationResolverProxy
(DestinationResolver<D> targetDestinationResolver) 指定されたターゲット DestinationResolver を使用して新しい CachingDestinationResolverProxy を作成し、実際に宛先を解決します。メソッドのサマリー
修飾子と型メソッド説明void
resolveDestination
(StringSE name) ターゲット DestinationResolver 実装によって正常に解決された場合、宛先を解決してキャッシュします。void
setTargetDestinationResolver
(DestinationResolver<D> targetDestinationResolver) 委譲先のターゲット DestinationResolver を設定します。
コンストラクターの詳細
CachingDestinationResolverProxy
public CachingDestinationResolverProxy()新しい CachingDestinationResolverProxy を作成し、setTargetDestinationResolver(org.springframework.messaging.core.DestinationResolver<D>)
Bean プロパティを介してターゲット DestinationResolver を設定します。CachingDestinationResolverProxy
指定されたターゲット DestinationResolver を使用して新しい CachingDestinationResolverProxy を作成し、実際に宛先を解決します。- パラメーター:
targetDestinationResolver
- 委譲先のターゲット DestinationResolver
メソッドの詳細
setTargetDestinationResolver
委譲先のターゲット DestinationResolver を設定します。afterPropertiesSet
public void afterPropertiesSet()インターフェースからコピーされた説明:InitializingBean
すべての Bean プロパティを設定し、BeanFactoryAware
、ApplicationContextAware
などを満たした後、包含BeanFactory
によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
- 次で指定:
- インターフェース
InitializingBean
のafterPropertiesSet
resolveDestination
ターゲット DestinationResolver 実装によって正常に解決された場合、宛先を解決してキャッシュします。- 次で指定:
- インターフェース
DestinationResolver<D>
のresolveDestination
- パラメーター:
name
- 解決される宛先名- 戻り値:
- 現在解決されている宛先またはすでにキャッシュされている宛先
- 例外:
DestinationResolutionException
- ターゲット DestinationResolver が宛先解決中にエラーを報告した場合