(List<BeanEntry>)_externalContext.getApplicationMap().get(INJECTED_BEAN_STORAGE_KEY);
//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
{
PhaseListener listener = (PhaseListener)
ClassUtils.newInstance(listenerClassName, PhaseListener.class);
Object creationMetaData = getInjectionProvider().inject(listener);
injectedBeanStorage.add(new BeanEntry(listener, creationMetaData));
getInjectionProvider().postConstruct(listener, creationMetaData);
lifecycle.addPhaseListener(listener);
}
catch (ClassCastException e)
{
log.severe("Class " + listenerClassName + " does not implement PhaseListener");
}
catch (InjectionProviderException e)
{
log.log(Level.SEVERE, "Error while injecting PhaseListener", e);
}
}
// if ProjectStage is Development, install the DebugPhaseListener
FacesContext facesContext = getFacesContext();
if (facesContext.isProjectStage(ProjectStage.Development) &&
MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isDebugPhaseListenerEnabled())
{
lifecycle.addPhaseListener(new DebugPhaseListener());
}
}
}