类 DelegatingPhaseListenerMulticaster
- java.lang.Object
- org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
- 所有已实现的接口:
Serializable
,EventListener
,PhaseListener
public class DelegatingPhaseListenerMulticaster extends Object implements PhaseListener
JSF PhaseListener implementation that delegates to one or more Spring-managed PhaseListener beans coming from the Spring root WebApplicationContext.Configure this listener multicaster in your
faces-config.xml
file as follows:<application> ... <phase-listener> org.springframework.web.jsf.DelegatingPhaseListenerMulticaster </phase-listener> ... </application>
The multicaster will delegate allbeforePhase
andafterPhase
events to all target PhaseListener beans. By default, those will simply be obtained by type: All beans in the Spring root WebApplicationContext that implement the PhaseListener interface will be fetched and invoked.Note: This multicaster's
getPhaseId()
method will always returnANY_PHASE
. The phase id exposed by the target listener beans will be ignored; all events will be propagated to all listeners.This multicaster may be subclassed to change the strategy used to obtain the listener beans, or to change the strategy used to access the ApplicationContext (normally obtained via
FacesContextUtils.getWebApplicationContext(FacesContext)
).- 从以下版本开始:
- 1.2.7
- 作者:
- Juergen Hoeller, Colin Sampaleanu
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 DelegatingPhaseListenerMulticaster()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPhase(PhaseEvent event)
void
beforePhase(PhaseEvent event)
protected ListableBeanFactory
getBeanFactory(FacesContext facesContext)
Retrieve the Spring BeanFactory to delegate bean name resolution to.protected Collection<PhaseListener>
getDelegates(FacesContext facesContext)
Obtain the delegate PhaseListener beans from the Spring root WebApplicationContext.PhaseId
getPhaseId()
protected WebApplicationContext
getWebApplicationContext(FacesContext facesContext)
Retrieve the web application context to delegate bean name resolution to.
构造器详细资料
DelegatingPhaseListenerMulticaster
public DelegatingPhaseListenerMulticaster()
方法详细资料
getPhaseId
public PhaseId getPhaseId()
- 指定者:
getPhaseId
在接口中PhaseListener
beforePhase
public void beforePhase(PhaseEvent event)
- 指定者:
beforePhase
在接口中PhaseListener
afterPhase
public void afterPhase(PhaseEvent event)
- 指定者:
afterPhase
在接口中PhaseListener
getDelegates
protected Collection<PhaseListener> getDelegates(FacesContext facesContext)
Obtain the delegate PhaseListener beans from the Spring root WebApplicationContext.- 参数:
facesContext
- the current JSF context- 返回:
- a Collection of PhaseListener objects
- 另请参阅:
getBeanFactory(javax.faces.context.FacesContext)
,ListableBeanFactory.getBeansOfType(Class)
getBeanFactory
protected ListableBeanFactory getBeanFactory(FacesContext facesContext)
Retrieve the Spring BeanFactory to delegate bean name resolution to.The default implementation delegates to
getWebApplicationContext
. Can be overridden to provide an arbitrary ListableBeanFactory reference to resolve against; usually, this will be a full Spring ApplicationContext.- 参数:
facesContext
- the current JSF context- 返回:
- the Spring ListableBeanFactory (never
null
) - 另请参阅:
getWebApplicationContext(javax.faces.context.FacesContext)
getWebApplicationContext
protected WebApplicationContext getWebApplicationContext(FacesContext facesContext)
Retrieve the web application context to delegate bean name resolution to.The default implementation delegates to FacesContextUtils.
- 参数:
facesContext
- the current JSF context- 返回:
- the Spring web application context (never
null
) - 另请参阅:
FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)