Package ch.qos.logback.classic.turbo

Examples of ch.qos.logback.classic.turbo.TurboFilter


        super.open();
    }

    @Override
    public Object addingService(ServiceReference reference) {
        TurboFilter tf = (TurboFilter) super.addingService(reference);
        tf.setContext(loggerContext);
        tf.start();

        attachFilter(tf);
        filters.put(reference,tf);
        return tf;
    }
View Full Code Here


        return tf;
    }

    @Override
    public void removedService(ServiceReference reference, Object service) {
        TurboFilter tf = (TurboFilter) service;
        filters.remove(reference);
        loggerContext.getTurboFilterList().remove(tf);
        super.removedService(reference, service);
    }
View Full Code Here

//    if (size == 0) {
//      return FilterReply.NEUTRAL;
//    }
    if (size == 1) {
      try {
        TurboFilter tf = get(0);
        return tf.decide(marker, logger, level, format, params, t);
      } catch (IndexOutOfBoundsException iobe) {
        return FilterReply.NEUTRAL;
      }
    }
   
    Object[] tfa = toArray();
    final int len = tfa.length;
    for (int i = 0; i < len; i++) {
    //for (TurboFilter tf : this) {
      final TurboFilter tf = (TurboFilter) tfa[i];
      final FilterReply r = tf.decide(marker, logger, level, format, params, t);
      if (r == FilterReply.DENY || r == FilterReply.ACCEPT) {
        return r;
      }
    }
    return FilterReply.NEUTRAL;
View Full Code Here

//    if (size == 0) {
//      return FilterReply.NEUTRAL;
//    }
    if (size == 1) {
      try {
        TurboFilter tf = get(0);
        return tf.decide(marker, logger, level, format, params, t);
      } catch (IndexOutOfBoundsException iobe) {
        return FilterReply.NEUTRAL;
      }
    }
   
    Object[] tfa = toArray();
    final int len = tfa.length;
    for (int i = 0; i < len; i++) {
    //for (TurboFilter tf : this) {
      final TurboFilter tf = (TurboFilter) tfa[i];
      final FilterReply r = tf.decide(marker, logger, level, format, params, t);
      if (r == FilterReply.DENY || r == FilterReply.ACCEPT) {
        return r;
      }
    }
    return FilterReply.NEUTRAL;
View Full Code Here

    // Although this test uses turbo filters, it only checks
    // that Joran can see the xml element and create
    // and place the relevant object correctly.
    configure(ClassicTestConstants.JORAN_INPUT_PREFIX + "turbo.xml");

    TurboFilter filter = loggerContext.getTurboFilterList().get(0);
    assertTrue(filter instanceof NOPTurboFilter);
  }
View Full Code Here

    // to that method.
    configure(ClassicTestConstants.JORAN_INPUT_PREFIX + "turbo2.xml");

    // StatusPrinter.print(loggerContext.getStatusManager());

    TurboFilter filter = loggerContext.getTurboFilterList().get(0);
    assertTrue(filter instanceof DebugUsersTurboFilter);
    DebugUsersTurboFilter dutf = (DebugUsersTurboFilter) filter;
    assertEquals(2, dutf.getUsers().size());
  }
View Full Code Here

//    if (size == 0) {
//      return FilterReply.NEUTRAL;
//    }
    if (size == 1) {
      try {
        TurboFilter tf = get(0);
        return tf.decide(marker, logger, level, format, params, t);
      } catch (IndexOutOfBoundsException iobe) {
        return FilterReply.NEUTRAL;
      }
    }
   
    Object[] tfa = toArray();
    final int len = tfa.length;
    for (int i = 0; i < len; i++) {
    //for (TurboFilter tf : this) {
      final TurboFilter tf = (TurboFilter) tfa[i];
      final FilterReply r = tf.decide(marker, logger, level, format, params, t);
      if (r == FilterReply.DENY || r == FilterReply.ACCEPT) {
        return r;
      }
    }
    return FilterReply.NEUTRAL;
View Full Code Here

  /**
   * Clear the filter chain
   */
  public void clearAllTurboFilters() {
    TurboFilter f = headFilter;
    while (f != null) {
      final TurboFilter next = f.getNext();
      f.setNext(null);
      f = next;
    }
    f = null;
    headFilter = null;
View Full Code Here

   * ACCEPT or DENY, then that value is returned. If all of the filters return
   * NEUTRAL, then  NEUTRAL is returned.
   */
  public final FilterReply getTurboFilterChainDecision(final Marker marker, final Logger logger,
      final Level level, final String format, final Object[] params, final Throwable t) {
    TurboFilter f = headFilter;

   
    while (f != null) {
      switch (f.decide(marker, logger,  level,  format, params,  t)) {
      case DENY:
        return FilterReply.DENY;

      case ACCEPT:
        return FilterReply.ACCEPT;

      case NEUTRAL:
        f = f.getNext();
      }
    }
    return FilterReply.NEUTRAL;
  }
View Full Code Here

//    if (size == 0) {
//      return FilterReply.NEUTRAL;
//    }
    if (size == 1) {
      try {
        TurboFilter tf = get(0);
        return tf.decide(marker, logger, level, format, params, t);
      } catch (IndexOutOfBoundsException iobe) {
        return FilterReply.NEUTRAL;
      }
    }
   
    Object[] tfa = toArray();
    final int len = tfa.length;
    for (int i = 0; i < len; i++) {
    //for (TurboFilter tf : this) {
      final TurboFilter tf = (TurboFilter) tfa[i];
      final FilterReply r = tf.decide(marker, logger, level, format, params, t);
      if (r == FilterReply.DENY || r == FilterReply.ACCEPT) {
        return r;
      }
    }
    return FilterReply.NEUTRAL;
View Full Code Here

TOP

Related Classes of ch.qos.logback.classic.turbo.TurboFilter

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.