code: @Override
      public void encodeBegin(FacesContext context) throws IOException {
          initState();
          notifyBefore(context, PhaseId.RENDER_RESPONSE);
  
          if (!context.getResponseComplete()) {
              super.encodeBegin(context);
          }
      }
docs: <p><span class="changed_added_2_0">Override</span> the default
  {@link UIComponentBase#encodeBegin} behavior.  If
  {@link #getBeforePhaseListener} returns non-<code>null</code>,
  invoke it, passing a {@link PhaseEvent} for the {@link
  PhaseId#RENDER_RESPONSE} phase.  If the internal list populated
  by calls to {@link #addPhaseListener} is non-empty, any listeners
  in that list must have their {@link PhaseListener#beforePhase}
  method called, passing the <code>PhaseEvent</code>.  Any errors
  that occur during invocation of any of the the beforePhase
  listeners must be logged and swallowed.  After listeners are invoked
  call superclass processing.</p>