Java 类ch.qos.logback.classic.spi.LoggerContextListener 实例源码

项目:konker-platform    文件:KonkerLoggerContext.java   
private void resetListenersExceptResetResistant() {
    ArrayList toRetain = new ArrayList();
    Iterator i$ = this.loggerContextListenerList.iterator();

    while(i$.hasNext()) {
        LoggerContextListener lcl = (LoggerContextListener)i$.next();
        if(lcl.isResetResistant()) {
            toRetain.add(lcl);
        }
    }

    this.loggerContextListenerList.retainAll(toRetain);
}
项目:bartleby    文件:JMXConfigurator.java   
private boolean previouslyRegisteredListenerWithSameObjectName() {
  List<LoggerContextListener> lcll = loggerContext.getCopyOfListenerList();
  for (LoggerContextListener lcl : lcll) {
    if (lcl instanceof JMXConfigurator) {
      JMXConfigurator jmxConfigurator = (JMXConfigurator) lcl;
      if (objectName.equals(jmxConfigurator.objectName)) {
        return true;
      }
    }
  }
  return false;
}
项目:bartleby    文件:LoggerContextListenerAction.java   
@Override
public void begin(InterpretationContext ec, String name, Attributes attributes)
        throws ActionException {

  inError = false;

  String className = attributes.getValue(CLASS_ATTRIBUTE);
  if (OptionHelper.isEmpty(className)) {
    addError("Mandatory \"" + CLASS_ATTRIBUTE
            + "\" attribute not set for <loggerContextListener> element");
    inError = true;
    return;
  }

  try {
    lcl = (LoggerContextListener) OptionHelper.instantiateByClassName(
            className, LoggerContextListener.class, context);

    if(lcl instanceof ContextAware) {
      ((ContextAware) lcl).setContext(context);
    }

    ec.pushObject(lcl);
    addInfo("Adding LoggerContextListener of type [" + className
            + "] to the object stack");

  } catch (Exception oops) {
    inError = true;
    addError("Could not create LoggerContextListener of type " + className + "].", oops);
  }
}
项目:bartleby    文件:LoggerContext.java   
private void resetListenersExceptResetResistant() {
  List<LoggerContextListener> toRetain = new ArrayList<LoggerContextListener>();

  for (LoggerContextListener lcl : loggerContextListenerList) {
    if (lcl.isResetResistant()) {
      toRetain.add(lcl);
    }
  }
  loggerContextListenerList.retainAll(toRetain);
}
项目:konker-platform    文件:KonkerLoggerContext.java   
public List<LoggerContextListener> getCopyOfListenerList() {
    return new ArrayList(this.loggerContextListenerList);
}
项目:bartleby    文件:LoggerContext.java   
public void addListener(LoggerContextListener listener) {
  loggerContextListenerList.add(listener);
}
项目:bartleby    文件:LoggerContext.java   
public void removeListener(LoggerContextListener listener) {
  loggerContextListenerList.remove(listener);
}
项目:bartleby    文件:LoggerContext.java   
public List<LoggerContextListener> getCopyOfListenerList() {
  return new ArrayList<LoggerContextListener>(loggerContextListenerList);
}
项目:bartleby    文件:LoggerContext.java   
void fireOnLevelChange(Logger logger, Level level) {
  for (LoggerContextListener listener : loggerContextListenerList) {
    listener.onLevelChange(logger, level);
  }
}
项目:bartleby    文件:LoggerContext.java   
private void fireOnReset() {
  for (LoggerContextListener listener : loggerContextListenerList) {
    listener.onReset(this);
  }
}
项目:bartleby    文件:LoggerContext.java   
private void fireOnStart() {
  for (LoggerContextListener listener : loggerContextListenerList) {
    listener.onStart(this);
  }
}
项目:bartleby    文件:LoggerContext.java   
private void fireOnStop() {
  for (LoggerContextListener listener : loggerContextListenerList) {
    listener.onStop(this);
  }
}