クラス DelegatingPhaseListenerMulticaster
java.lang.ObjectSE
org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
- 実装されたすべてのインターフェース:
PhaseListenerEE
、SerializableSE
、EventListenerSE
Spring ルート WebApplicationContext からの 1 つ以上の Spring 管理の PhaseListener Bean に委譲する JSF PhaseListener 実装。
次のように、faces-config.xml
ファイルでこのリスナーマルチキャスターを構成します。
<application> ... <phase-listener> org.springframework.web.jsf.DelegatingPhaseListenerMulticaster </phase-listener> ... </application>マルチキャストは、すべての
beforePhase
および afterPhase
イベントをすべてのターゲット PhaseListener Bean に委譲します。デフォルトでは、これらは単に型別に取得されます。PhaseListener インターフェースを実装する Spring ルート WebApplicationContext 内のすべての Bean がフェッチされ、呼び出されます。 メモ: このマルチキャスターの getPhaseId()
メソッドは常に ANY_PHASE
を返します。 ターゲットリスナー Bean によって公開されるフェーズ ID は無視されます。すべてのイベントはすべてのリスナーに伝播されます。
このマルチキャスターをサブクラス化して、リスナー Bean を取得するために使用される戦略を変更したり、ApplicationContext(通常は FacesContextUtils.getWebApplicationContext(FacesContext)
を介して取得)にアクセスするために使用される戦略を変更したりできます。
- 導入:
- 1.2.7
- 作成者:
- Juergen Hoeller, Colin Sampaleanu
- 関連事項:
コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明void
afterPhase
(PhaseEventEE event) void
beforePhase
(PhaseEventEE event) protected ListableBeanFactory
getBeanFactory
(FacesContextEE facesContext) Bean 名前解決を委譲する Spring BeanFactory を取得します。protected CollectionSE<PhaseListenerEE>
getDelegates
(FacesContextEE facesContext) Spring ルート WebApplicationContext からデリゲート PhaseListener Bean を取得します。protected WebApplicationContext
getWebApplicationContext
(FacesContextEE facesContext) Bean 名前解決を委譲する Web アプリケーションコンテキストを取得します。
コンストラクターの詳細
DelegatingPhaseListenerMulticaster
public DelegatingPhaseListenerMulticaster()
メソッドの詳細
getPhaseId
- 次で指定:
- インターフェース
PhaseListenerEE
のgetPhaseIdEE
beforePhase
- 次で指定:
- インターフェース
PhaseListenerEE
のbeforePhaseEE
afterPhase
- 次で指定:
- インターフェース
PhaseListenerEE
のafterPhaseEE
getDelegates
Spring ルート WebApplicationContext からデリゲート PhaseListener Bean を取得します。- パラメーター:
facesContext
- 現在の JSF コンテキスト- 戻り値:
- PhaseListener オブジェクトのコレクション
- 関連事項:
getBeanFactory
Bean 名前解決を委譲する Spring BeanFactory を取得します。デフォルトの実装は
getWebApplicationContext
に委譲します。オーバーライドして、解決する任意の ListableBeanFactory 参照を提供できます。通常、これは完全な Spring ApplicationContext になります。- パラメーター:
facesContext
- 現在の JSF コンテキスト- 戻り値:
- Spring ListableBeanFactory (非
null
) - 関連事項:
getWebApplicationContext
Bean 名前解決を委譲する Web アプリケーションコンテキストを取得します。デフォルトの実装は FacesContextUtils に委譲します。
- パラメーター:
facesContext
- 現在の JSF コンテキスト- 戻り値:
- Spring Web アプリケーションコンテキスト (非
null
) - 関連事項: