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


Java InterpretationContext.popObject方法代码示例

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


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

示例1: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
/**
 * Once the children elements are also parsed, now is the time to activate the
 * shutdown hook options.
 */
@Override
public void end(InterpretationContext ic, String name) throws ActionException {
  if (inError) {
    return;
  }
    
  Object o = ic.peekObject();
  if (o != hook) {
    addWarn("The object at the of the stack is not the hook pushed earlier.");
  } else {
    ic.popObject();
      
    Thread hookThread = new Thread(hook, "Logback shutdown hook [" + context.getName() + "]");
        
    context.putObject(CoreConstants.SHUTDOWN_HOOK_THREAD, hookThread);
    Runtime.getRuntime().addShutdownHook(hookThread);      
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:23,代码来源:ShutdownHookAction.java

示例2: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
/**
 * Now property definer is initialized by all properties and we can put
 * property value to context
 */
public void end(InterpretationContext ec, String name) {
  if (inError) {
    return;
  }

  Object o = ec.peekObject();

  if (o != definer) {
    addWarn("The object at the of the stack is not the property definer for property named ["
        + propertyName + "] pushed earlier.");
  } else {
    addInfo("Popping property definer for property named [" + propertyName
        + "] from the object stack");
    ec.popObject();
    // let's put defined property and value to context but only if it is
    // not null
    String propertyValue = definer.getPropertyValue();
    if(propertyValue != null) {
      ActionUtil.setProperty(ec, propertyName, propertyValue, scope);
    }
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:27,代码来源:DefinePropertyAction.java

示例3: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
/**
 * 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();
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:23,代码来源:AppenderAction.java

示例4: 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 != context) {
    addWarn(
      "The object at the of the stack is not the context named ["
      + context.getName() + "] pushed earlier.");
  } else {
    addInfo(
      "Popping context named [" + context.getName()
      + "] from the object stack");
    ec.popObject();
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:20,代码来源:FruitContextAction.java

示例5: 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

示例6: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
@Override
public void end(InterpretationContext ic, String name)
    throws ActionException {
  
  if (inError) return;
  
  ic.getContext().register(receiver);
  receiver.start();
  
  Object o = ic.peekObject();
  if (o != receiver) {
    addWarn("The object at the of the stack is not the remote " +
    		"pushed earlier.");
  } else {
    ic.popObject();
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:18,代码来源:ReceiverAction.java

示例7: 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 != 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();
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:19,代码来源:LoggerContextListenerAction.java

示例8: fetchInteger

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
/**
 * Pop the Integer object at the top of the stack. This code illustrates usage
 * of Joran's error handling paradigm.
 */
int fetchInteger(InterpretationContext ic) {
  int result = 0;

  try {
    Object o1 = ic.popObject();

    if (o1 instanceof Integer) {
      result = ((Integer) o1).intValue();
    } else {
      String errMsg = "Object [" + o1
          + "] currently at the top of the stack is not an integer.";
      ic.addError(errMsg);
      throw new IllegalArgumentException(errMsg);
    }
  } catch (EmptyStackException ese) {
    ic.addError("Expecting an integer on the execution stack.");
    throw ese;
  }
  return result;
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:25,代码来源:MultiplyAction.java

示例9: fetchInteger

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
/**
 * Pop the Integer object at the top of the stack.
 * This code also  illustrates usage of Joran's error handling paradigm. 
 */
int fetchInteger(InterpretationContext ic) {
  int result = 0;

  try {
    // Pop the object at the top of the interpretation context's stack.
    Object o1 = ic.popObject();

    if (o1 instanceof Integer) {
      result = ((Integer) o1).intValue();
    } else {
      String errMsg =
        "Object [" + o1
        + "] currently at the top of the stack is not an integer.";
      ic.addError(errMsg);
      throw new IllegalArgumentException(errMsg);
    }
  } catch (EmptyStackException ese) {
    ic.addError(("Expecting an integer on the execution stack."));
    throw ese;
  }
  return result;
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:27,代码来源:AddAction.java

示例10: verifyAndPop

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
private void verifyAndPop(InterpretationContext ic) {
	Object o = ic.peekObject();
	Assert.state(o != null, "Unexpected null object on stack");
	Assert.isInstanceOf(SpringProfileAction.class, o, "logback stack error");
	Assert.state(o == this, "ProfileAction different than current one on stack");
	ic.popObject();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:SpringProfileAction.java

示例11: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
/**
 * Once the children elements are also parsed, now is the time to activate the
 * evaluator options.
 */
@SuppressWarnings("unchecked")
public void end(InterpretationContext ec, String e) {
  if (inError) {
    return;
  }

  if (evaluator instanceof LifeCycle) {
    ((LifeCycle) evaluator).start();
    addInfo("Starting evaluator named [" + evaluator.getName() + "]");
  }

  Object o = ec.peekObject();

  if (o != evaluator) {
    addWarn("The object on the top the of the stack is not the evaluator pushed earlier.");
  } else {
    ec.popObject();

    try {
      Map<String, EventEvaluator<?>> evaluatorMap = (Map<String, EventEvaluator<?>>) context
          .getObject(CoreConstants.EVALUATOR_MAP);
      if(evaluatorMap == null) {
        addError("Could not find EvaluatorMap");
      } else {
        evaluatorMap.put(evaluator.getName(), evaluator);
      }
    } catch (Exception ex) {
      addError("Could not set evaluator named [" + evaluator + "].", ex);
    }
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:36,代码来源:AbstractEventEvaluatorAction.java

示例12: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
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();
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:15,代码来源:StatusListenerAction.java

示例13: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
public void end(InterpretationContext ec, String e) {
  if (inError) {
    return;
  }
  Object o = ec.peekObject();
  if (o != logger) {
    addWarn("The object on the top the of the stack is not "+logger+" pushed earlier");
    addWarn("It is: " + o);
  } else {
    ec.popObject();
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:13,代码来源:LoggerAction.java

示例14: end

import ch.qos.logback.core.joran.spi.InterpretationContext; //导入方法依赖的package包/类
public void end(InterpretationContext ec, String name) {
  if (inError) {
    return;
  }
  Object o = ec.peekObject();
  if (o != root) {
    addWarn("The object on the top the of the stack is not the root logger");
    addWarn("It is: " + o);
  } else {
    ec.popObject();
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:13,代码来源:RootLoggerAction.java

示例15: end

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

  IfState state = stack.pop();
  if(!state.active) {
    return;
  }
 
  
  Object o = ic.peekObject();
  if (o == null) {
    throw new IllegalStateException("Unexpected null object on stack");
  }
  if (!(o instanceof IfAction)) {
    throw new IllegalStateException("Unexpected object of type ["
        + o.getClass() + "] on stack");
  }

  if (o != this) {
    throw new IllegalStateException(
        "IfAction different then current one on stack");
  }
  ic.popObject();

  if (state.boolResult == null) {
    addError("Failed to determine \"if then else\" result");
    return;
  }

  Interpreter interpreter = ic.getJoranInterpreter();
  List<SaxEvent> listToPlay = state.thenSaxEventList;
  if (!state.boolResult) {
    listToPlay = state.elseSaxEventList;
  }

  // if boolResult==false & missing else,  listToPlay may be null
  if(listToPlay != null) {
    // insert past this event
    interpreter.getEventPlayer().addEventsDynamically(listToPlay, 1);
  }

}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:43,代码来源:IfAction.java


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