/**
   * {@inheritDoc}
   *
   * @since 0.7
   */
  public void begin(ExecutionContext ec, String name, Attributes attributes)
      throws ActionException {
    if (isInheritedMode()) {
      return;
    }
    // Let us forget about previous errors (in this object)
    inError = false;

    String className = attributes.getValue(CLASS_ATTRIBUTE);
    try {
      getLogger().finer("About to instantiate layout of type [" + className + "]");

      formatter =
          (ExtendedFormatter)
              OptionConverter.instantiateByClassName(
                  className, org.x4juli.global.spi.ExtendedFormatter.class, null);

      LoggerRepository repo = (LoggerRepository) ec.getObjectStack().get(0);
      formatter.setLoggerRepository(repo);

      getLogger().finer("Pushing layout on top of the object stack.");
      ec.pushObject(formatter);
    } catch (Exception oops) {
      inError = true;
      getLogger().log(Level.SEVERE, "Could not create an Layout. Reported error follows.", oops);
      ec.addError(new ErrorItem("Could not create layout of type " + className + "]."));
    }
  }