private boolean _process ( FacesContext context , PhaseId phaseId , PhaseProcessor processor ) { RuntimeException processingException = null ; try { if ( ! notifyListeners ( context , phaseId , getBeforePhaseListener ( ) , true ) ) { try { if ( processor != null ) { processor . process ( context , this ) ; } broadcastEvents ( context , phaseId ) ; } catch ( RuntimeException re ) { // catch any Exception that occures while processing the phase // to ensure invocation of the afterPhase methods processingException = re ; } } } finally { if ( context . getRenderResponse ( ) || context . getResponseComplete ( ) ) { clearEvents ( ) ; } } boolean retVal = notifyListeners ( context , phaseId , getAfterPhaseListener ( ) , false ) ; if ( processingException == null ) { return retVal ; } else { throw processingException ; } }
Process the specified phase by calling PhaseListener . beforePhase for every phase listeners defined on this view root then calling the process method of the processor broadcasting relevant events and finally notifying the afterPhase method of every phase listeners registered on this view root .