当前位置: 首页>>代码示例>>Java>>正文


Java InterpretationContext.getContext方法代码示例

本文整理汇总了Java中ch.qos.logback.core.joran.spi.InterpretationContext.getContext方法的典型用法代码示例。如果您正苦于以下问题:Java InterpretationContext.getContext方法的具体用法?Java InterpretationContext.getContext怎么用?Java InterpretationContext.getContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.qos.logback.core.joran.spi.InterpretationContext的用法示例。


在下文中一共展示了InterpretationContext.getContext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
@Override
public void end(InterpretationContext ec, String name) throws ActionException {
  if (inError) {
    return;
  }

  Object o = ec.peekObject();

  if (o != fruitShell) {
    addWarn(
      "The object at the of the stack is not the fruitShell named ["
      + fruitShell.getName() + "] pushed earlier.");
  } else {
    addInfo(
      "Popping fruitSHell named [" + fruitShell.getName()
      + "] from the object stack");
    ec.popObject();
    FruitContext fruitContext = (FruitContext) ec.getContext();
    fruitContext.addFruitShell(fruitShell);
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:22,代码来源:FruitShellAction.java

示例2: setProperties

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
/**
 * Add all the properties found in the argument named 'props' to an
 * InterpretationContext.
 */
static public void setProperties(InterpretationContext ic, Properties props,
    Scope scope) {
  switch (scope) {
  case LOCAL:
    ic.addSubstitutionProperties(props);
    break;
  case CONTEXT:
    ContextUtil cu = new ContextUtil(ic.getContext());
    cu.addProperties(props);
    break;
  case SYSTEM:
    OptionHelper.setSystemProperties(ic, props);
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:19,代码来源:ActionUtil.java

示例3: begin

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
@Override
public void begin(InterpretationContext ec, String name, Attributes attributes)
    throws ActionException {
  String portStr = attributes.getValue(PORT_ATTR);
  Integer port = null;
  
  if (portStr == null) {
    port = DEFAULT_PORT;
  } else {
    try {
      port = Integer.valueOf(portStr);
    } catch (NumberFormatException ex) {
      addError("Port " + portStr
          + " in ConsolePlugin config is not a correct number");
    }
  }

  LoggerContext lc = (LoggerContext)ec.getContext();
  SocketAppender appender = new SocketAppender();
  appender.setContext(lc);
  appender.setIncludeCallerData(true);
  appender.setRemoteHost("localhost");
  appender.setPort(port.intValue());
  appender.start();
  Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
  root.addAppender(appender);
  
  addInfo("Sending LoggingEvents to the plugin using port " + port);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:30,代码来源:ConsolePluginAction.java


注:本文中的ch.qos.logback.core.joran.spi.InterpretationContext.getContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。