code: public void setPhase(final String phase) {
          PhaseId myPhaseId = PhaseId.phaseIdValueOf(phase);
          if (PhaseId.ANY_PHASE.equals(myPhaseId) || 
              PhaseId.RESTORE_VIEW.equals(myPhaseId) || 
              PhaseId.RENDER_RESPONSE.equals(myPhaseId)) {
              throw new FacesException("View actions cannot be executed in specified phase: [" + myPhaseId.toString() + "]");
          }
          getStateHelper().put(PropertyKeys.phase, myPhaseId);
      }
docs: <p class="changed_added_2_2">Attempt to set the lifecycle phase
  in which this instance will queue its {@link ActionEvent}.  Pass
  the argument <code>phase</code> to {@link
  PhaseId#phaseIdValueOf}.  If the result is not one of the
  following values, <code>FacesException</code> must be thrown.</p>
  
  <ul>
  
  <li><p>{@link PhaseId#APPLY_REQUEST_VALUES}</p></li>
  <li><p>{@link PhaseId#PROCESS_VALIDATIONS}</p></li>
  <li><p>{@link PhaseId#UPDATE_MODEL_VALUES}</p></li>
  <li><p>{@link PhaseId#INVOKE_APPLICATION}</p></li>
  
  </ul>
  
  <p>If set, this value takes precedence over the immediate flag.</p>
  
  @since 2.2