= (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
//Lifecycle lifecycle = lifecycleFactory.getLifecycle(getLifecycleId());
for (Iterator<String> it = lifecycleFactory.getLifecycleIds(); it.hasNext();)
{
Lifecycle lifecycle = lifecycleFactory.getLifecycle(it.next());
// add phase listeners
for (String listenerClassName : getDispenser().getLifecyclePhaseListeners())
{
try
{
lifecycle.addPhaseListener((PhaseListener)
ClassUtils.newInstance(listenerClassName, PhaseListener.class));
}
catch (ClassCastException e)
{
log.severe("Class " + listenerClassName + " does not implement PhaseListener");
}
}
// if ProjectStage is Development, install the DebugPhaseListener
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext.isProjectStage(ProjectStage.Development) &&
MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isDebugPhaseListenerEnabled())
{
lifecycle.addPhaseListener(new DebugPhaseListener());
}
}
}