Package org.apache.log4j.spi

Examples of org.apache.log4j.spi.OptionHandler


    throws MBeanException,
    ReflectionException {

    if(operationName.equals("activateOptions") &&
                     appender instanceof OptionHandler) {
      OptionHandler oh = (OptionHandler) appender;
      oh.activateOptions();
      return "Options activated.";
    } else if (operationName.equals("setLayout")) {
      Layout layout = (Layout) OptionConverter.instantiateByClassName((String)
                      params[0],
                      Layout.class,
View Full Code Here


    throws MBeanException,
    ReflectionException {

    if(operationName.equals("activateOptions") &&
                     layout instanceof OptionHandler) {
      OptionHandler oh = (OptionHandler) layout;
      oh.activateOptions();
      return "Options activated.";
    }
    return null;
  }
View Full Code Here

    throws MBeanException,
    ReflectionException {
  
    if(operationName.equals("activateOptions") &&
                     layout instanceof OptionHandler) {
      OptionHandler oh = (OptionHandler) layout;
      oh.activateOptions();
      return "Options activated.";
    }
    return null;
  }
View Full Code Here

    throws MBeanException,
    ReflectionException {
  
    if(operationName.equals("activateOptions") &&
                     appender instanceof OptionHandler) {
      OptionHandler oh = (OptionHandler) appender;
      oh.activateOptions();
      return "Options activated.";
    } else if (operationName.equals("setLayout")) {
      Layout layout = (Layout) OptionConverter.instantiateByClassName((String)
                      params[0],
                      Layout.class,
View Full Code Here

     */
  public boolean parseUnrecognizedElement(final Element element,
                                          final Properties props) throws Exception {
      final String nodeName = element.getNodeName();
      if ("rollingPolicy".equals(nodeName)) {
          OptionHandler rollingPolicy =
                  org.apache.log4j.extras.DOMConfigurator.parseElement(
                          element, props, RollingPolicy.class);
          if (rollingPolicy != null) {
              rollingPolicy.activateOptions();
              this.setRollingPolicy((RollingPolicy) rollingPolicy);
          }
          return true;
      }
      if ("triggeringPolicy".equals(nodeName)) {
          OptionHandler triggerPolicy =
                  org.apache.log4j.extras.DOMConfigurator.parseElement(
                          element, props, TriggeringPolicy.class);
          if (triggerPolicy != null) {
              triggerPolicy.activateOptions();
              this.setTriggeringPolicy((TriggeringPolicy) triggerPolicy);
          }
          return true;
      }
      return false;
View Full Code Here

     */
  public boolean parseUnrecognizedElement(final Element element,
                                          final Properties props) throws Exception {
      final String nodeName = element.getNodeName();
      if ("filter".equals(nodeName)) {
          OptionHandler filter =
                  org.apache.log4j.extras.DOMConfigurator.parseElement(
                          element, props, Filter.class);
          if (filter instanceof Filter) {
              filter.activateOptions();
              this.addFilter((Filter) filter);
          }
          return true;
      }
      return false;
View Full Code Here

   
  } else if(tagName.equals(PRIORITY_TAG)) {
    parsePriority(currentElement, cat, isRoot)
  } else if(tagName.equals(PARAM_TAG)) {
    if(cat instanceof OptionHandler) {
      OptionHandler oh = (OptionHandler) cat;
      parseParameters(currentElement, oh);
      oh.activateOptions();
    }
  }
      }
    }
  }
View Full Code Here

        //     (for example, triggeringPolicy of org.apache.log4j.rolling.RollingFileAppender)
        PropertyDescriptor prop = getPropertyDescriptor(Introspector.decapitalize(key));
        if (prop != null
                && OptionHandler.class.isAssignableFrom(prop.getPropertyType())
                && prop.getWriteMethod() != null) {
            OptionHandler opt = (OptionHandler)
                    OptionConverter.instantiateByKey(properties, prefix + key,
                                  prop.getPropertyType(),
                                  null);
            PropertySetter setter = new PropertySetter(opt);
            setter.setProperties(properties, prefix + key + ".");
View Full Code Here

    throws MBeanException,
    ReflectionException {

    if(operationName.equals("activateOptions") &&
                     appender instanceof OptionHandler) {
      OptionHandler oh = (OptionHandler) appender;
      oh.activateOptions();
      return "Options activated.";
    } else if (operationName.equals("setLayout")) {
      Layout layout = (Layout) OptionConverter.instantiateByClassName((String)
                      params[0],
                      Layout.class,
View Full Code Here

    throws MBeanException,
    ReflectionException {

    if(operationName.equals("activateOptions") &&
                     layout instanceof OptionHandler) {
      OptionHandler oh = layout;
      oh.activateOptions();
      return "Options activated.";
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.apache.log4j.spi.OptionHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.