private void configureLifecycle() { // create the lifecycle used by the app LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder .getFactory(FactoryFinder.LIFECYCLE_FACTORY); Lifecycle lifecycle = lifecycleFactory.getLifecycle(getLifecycleId()); // add phase listeners for (Iterator iterator = getDispenser().getLifecyclePhaseListeners(); iterator.hasNext();) { String listenerClassName = (String) iterator.next(); try { lifecycle.addPhaseListener((PhaseListener) ClassUtils.newInstance(listenerClassName)); } catch (ClassCastException e) { log.error("Class " + listenerClassName + " does not implement PhaseListener"); } } }
private void configureLifecycle() { // create the lifecycle used by the app LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); Lifecycle lifecycle = lifecycleFactory.getLifecycle(getLifecycleId()); // 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)) { lifecycle.addPhaseListener(new DebugPhaseListener()); } }
private void configureLifecycle() { // create the lifecycle used by the app LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); Lifecycle lifecycle = lifecycleFactory.getLifecycle(getLifecycleId()); // 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)) { lifecycle.addPhaseListener(new DebugPhaseListener()); } }