PhaseListener phaseListener = phaseListeners[i];
int listenerPhaseId = phaseListener.getPhaseId().getOrdinal();
if (listenerPhaseId == PhaseId.ANY_PHASE.getOrdinal() ||
listenerPhaseId == phaseId.getOrdinal())
{
phaseListener.beforePhase(new PhaseEvent(facesContext, phaseId, this));
}
}
}