ch.qos.logback.core.spi.LifeCycle类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(345)

本文整理了Java中ch.qos.logback.core.spi.LifeCycle类的一些代码示例,展示了LifeCycle类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LifeCycle类的具体详情如下:
包路径:ch.qos.logback.core.spi.LifeCycle
类名称:LifeCycle

LifeCycle介绍

暂无

代码示例

代码示例来源:origin: org.springframework.boot/spring-boot

public void start(LifeCycle lifeCycle) {
  if (lifeCycle instanceof ContextAware) {
    ((ContextAware) lifeCycle).setContext(this.context);
  }
  lifeCycle.start();
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Resets this manager.
 * <p>
 * All registered components are stopped and removed from the manager.
 */
public void reset() {
 for (LifeCycle component : components) {
  if (component.isStarted()) {
   component.stop();
  }
 }
 components.clear();
}

代码示例来源:origin: org.apache.logging.log4j/log4j-core

@Override
public void shutdown() {
  ((LifeCycle) LoggerFactory.getILoggerFactory()).stop();
}

代码示例来源:origin: ch.qos.logback/logback-classic

@Override
public void end(InterpretationContext ec, String name) throws ActionException {
  if (inError) {
    return;
  }
  Object o = ec.peekObject();
  if (o != lcl) {
    addWarn("The object on the top the of the stack is not the LoggerContextListener pushed earlier.");
  } else {
    if (lcl instanceof LifeCycle) {
      ((LifeCycle) lcl).start();
      addInfo("Starting LoggerContextListener");
    }
    ((LoggerContext) context).addListener(lcl);
    ec.popObject();
  }
}

代码示例来源:origin: com.hynnet/logback-core

/**
 * Resets this manager.
 * <p>
 * All registered components are stopped and removed from the manager.
 */
public void reset() {
 for (LifeCycle component : components) {
  if (component.isStarted()) {
   component.stop();
  }
 }
 components.clear();
}

代码示例来源:origin: camunda/camunda-bpm-platform

private static void initListener(LoggerContext loggerContext, StatusListener listener) {
 if (listener != null) {
  if(listener instanceof ContextAware) // LOGBACK-767
   ((ContextAware) listener).setContext(loggerContext);
  if(listener instanceof LifeCycle)  // LOGBACK-767
   ((LifeCycle) listener).start();
  loggerContext.getStatusManager().add(listener);
 }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Resets this manager.
 * <p>
 * All registered components are stopped and removed from the manager.
 */
public void reset() {
  for (LifeCycle component : components) {
    if (component.isStarted()) {
      component.stop();
    }
  }
  components.clear();
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void end(InterpretationContext ec, String e) {
  if (inError) {
   return;
  }
  if (statusListener instanceof LifeCycle) {
   ((LifeCycle) statusListener).start();
  }
  Object o = ec.peekObject();
  if (o != statusListener) {
   addWarn("The object at the of the stack is not the statusListener pushed earlier.");
  } else {
   ec.popObject();
  }
 }
}

代码示例来源:origin: Nextdoor/bender

/**
 * Resets this manager.
 * <p>
 * All registered components are stopped and removed from the manager.
 */
public void reset() {
  for (LifeCycle component : components) {
    if (component.isStarted()) {
      component.stop();
    }
  }
  components.clear();
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
  * Once the children elements are also parsed, now is the time to activate the
  * appender options.
  */
 public void end(InterpretationContext ec, String name) {
  if (inError) {
   return;
  }

  if (appender instanceof LifeCycle) {
   ((LifeCycle) appender).start();
  }

  Object o = ec.peekObject();

  if (o != appender) {
   addWarn("The object at the of the stack is not the appender named ["
     + appender.getName() + "] pushed earlier.");
  } else {
   ec.popObject();
  }
 }
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Resets this manager.
 * <p>
 * All registered components are stopped and removed from the manager.
 */
public void reset() {
  for (LifeCycle component : components) {
    if (component.isStarted()) {
      component.stop();
    }
  }
  components.clear();
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public void end(InterpretationContext ec, String name) throws ActionException {
 if (inError) {
  return;
 }
 Object o = ec.peekObject();
 if (o != lcl) {
  addWarn("The object on the top the of the stack is not the LoggerContextListener pushed earlier.");
 } else {
  if (lcl instanceof LifeCycle) {
   ((LifeCycle) lcl).start();
   addInfo("Starting LoggerContextListener");
  }
  ((LoggerContext) context).addListener(lcl);
  ec.popObject();
 }
}

代码示例来源:origin: tony19/logback-android

/**
  * Resets this manager.
  * <p>
  * All registered components are stopped and removed from the manager.
  */
 public void reset() {
  for (LifeCycle component : components) {
   if (component.isStarted()) {
    component.stop();
   }
  }
  components.clear();
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

((LifeCycle) evaluator).start();
addInfo("Starting evaluator named [" + evaluator.getName() + "]");

代码示例来源:origin: camunda/camunda-bpm-platform

definer.setContext(context);
if(definer instanceof LifeCycle) {
 ((LifeCycle) definer).start();

代码示例来源:origin: camunda/camunda-bpm-platform

if (nestedComplexProperty instanceof LifeCycle
  && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) {
 ((LifeCycle) nestedComplexProperty).start();

代码示例来源:origin: org.antframework.boot/ant-boot-starter-log

public void start(LifeCycle lifeCycle) {
  if (lifeCycle instanceof ContextAware) {
    ((ContextAware) lifeCycle).setContext(this.context);
  }
  lifeCycle.start();
}

代码示例来源:origin: tony19/logback-android

private static void initAndAddListener(Context context, StatusListener listener) {
 if (listener != null) {
  if (listener instanceof ContextAware) // LOGBACK-767
   ((ContextAware) listener).setContext(context);
  boolean effectivelyAdded = context.getStatusManager().add(listener);
  if (effectivelyAdded && (listener instanceof LifeCycle)) {
   ((LifeCycle) listener).start(); // LOGBACK-767
  }
 }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

private static void initAndAddListener(Context context, StatusListener listener) {
  if (listener != null) {
    if (listener instanceof ContextAware) // LOGBACK-767
      ((ContextAware) listener).setContext(context);
    boolean effectivelyAdded = context.getStatusManager().add(listener);
    if (effectivelyAdded && (listener instanceof LifeCycle)) {
      ((LifeCycle) listener).start(); // LOGBACK-767
    }
  }
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

private static void initAndAddListener(Context context, StatusListener listener) {
  if (listener != null) {
    if (listener instanceof ContextAware) // LOGBACK-767
      ((ContextAware) listener).setContext(context);
    boolean effectivelyAdded = context.getStatusManager().add(listener);
    if (effectivelyAdded && (listener instanceof LifeCycle)) {
      ((LifeCycle) listener).start(); // LOGBACK-767
    }
  }
}

相关文章

微信公众号

最新文章

更多