@SuppressWarnings("unchecked") public Appender<ILoggingEvent> getAppender() { Map<String, Object> omap = interpreter.getInterpretationContext().getObjectMap(); HashMap<String, Appender<?>> appenderMap = (HashMap<String, Appender<?>>) omap.get(ActionConst.APPENDER_BAG); oneAndOnlyOneCheck(appenderMap); Collection<Appender<?>> values = appenderMap.values(); if (values.size() == 0) { return null; } return (Appender<ILoggingEvent>) values.iterator().next(); } }
@Override protected void buildInterpreter() { super.buildInterpreter(); Map<String, Object> omap = interpreter.getInterpretationContext().getObjectMap(); omap.put(ActionConst.APPENDER_BAG, new HashMap<String, Appender<?>>()); //omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap()); Map<String, String> propertiesMap = new HashMap<String, String>(); propertiesMap.putAll(parentPropertyMap); propertiesMap.put(key, value); interpreter.setInterpretationContextPropertiesMap(propertiesMap); }
/** * @deprecated replaced by {@link #getInterpretationContext()} */ public InterpretationContext getExecutionContext() { return getInterpretationContext(); }
public InterpretationContext getInterpretationContext() { return interpreter.getInterpretationContext(); } }
@SuppressWarnings("unchecked") public Appender<ILoggingEvent> getAppender() { Map<String, Object> omap = interpreter.getInterpretationContext().getObjectMap(); HashMap appenderMap = (HashMap) omap.get(ActionConst.APPENDER_BAG); oneAndOnlyOneCheck(appenderMap); Collection values = appenderMap.values(); if(values.size() == 0) { return null; } return (Appender<ILoggingEvent>) values.iterator().next(); } }
@Override protected void buildInterpreter() { super.buildInterpreter(); Map<String, Object> omap = interpreter.getInterpretationContext() .getObjectMap(); omap.put(ActionConst.APPENDER_BAG, new HashMap()); omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap()); }
@Override protected void buildInterpreter() { super.buildInterpreter(); Map<String, Object> omap = interpreter.getInterpretationContext().getObjectMap(); omap.put(ActionConst.APPENDER_BAG, new HashMap()); omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap()); Map<String, String> propertiesMap = new HashMap<String, String>(); propertiesMap.putAll(parentPropertyMap); propertiesMap.put(key, value); interpreter.setInterpretationContextPropertiesMap(propertiesMap); }
public void play(List<SaxEvent> aSaxEventList) { eventList = aSaxEventList; SaxEvent se; for(currentIndex = 0; currentIndex < eventList.size(); currentIndex++) { se = eventList.get(currentIndex); if(se instanceof StartEvent) { interpreter.startElement((StartEvent) se); // invoke fireInPlay after startElement processing interpreter.getInterpretationContext().fireInPlay(se); } if(se instanceof BodyEvent) { // invoke fireInPlay before characters processing interpreter.getInterpretationContext().fireInPlay(se); interpreter.characters((BodyEvent) se); } if(se instanceof EndEvent) { // invoke fireInPlay before endElement processing interpreter.getInterpretationContext().fireInPlay(se); interpreter.endElement((EndEvent) se); } } }
protected void buildInterpreter() { RuleStore rs = new SimpleRuleStore(context); addInstanceRules(rs); this.interpreter = new Interpreter(context, rs, initialElementPath()); InterpretationContext interpretationContext = interpreter.getInterpretationContext(); interpretationContext.setContext(context); addImplicitRules(interpreter); addDefaultNestedComponentRegistryRules(interpretationContext.getDefaultNestedComponentRegistry()); }
/** * @deprecated replaced by {@link #getInterpretationContext()} * @return the interpretation context of the interpreter */ public InterpretationContext getExecutionContext() { return getInterpretationContext(); }
/** * @deprecated replaced by {@link #getInterpretationContext()} */ public InterpretationContext getExecutionContext() { return getInterpretationContext(); }
@SuppressWarnings("unchecked") public Appender<ILoggingEvent> getAppender() { Map<String, Object> omap = interpreter.getInterpretationContext().getObjectMap(); HashMap<String, Appender<?>> appenderMap = (HashMap<String, Appender<?>>) omap.get(ActionConst.APPENDER_BAG); oneAndOnlyOneCheck(appenderMap); Collection<Appender<?>> values = appenderMap.values(); if(values.size() == 0) { return null; } return (Appender<ILoggingEvent>) values.iterator().next(); } }
@Override protected void buildInterpreter() { super.buildInterpreter(); Map<String, Object> omap = interpreter.getInterpretationContext() .getObjectMap(); omap.put(ActionConst.APPENDER_BAG, new HashMap()); omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap()); }
@Override protected void buildInterpreter() { super.buildInterpreter(); Map<String, Object> omap = interpreter.getInterpretationContext() .getObjectMap(); omap.put(ActionConst.APPENDER_BAG, new HashMap<String, Appender<?>>()); //omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap()); }
@Override protected void buildInterpreter() { super.buildInterpreter(); Map<String, Object> omap = interpreter.getInterpretationContext().getObjectMap(); omap.put(ActionConst.APPENDER_BAG, new HashMap<String, Appender<?>>()); //omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap()); Map<String, String> propertiesMap = new HashMap<String, String>(); propertiesMap.putAll(parentPropertyMap); propertiesMap.put(key, value); interpreter.setInterpretationContextPropertiesMap(propertiesMap); }
@Override protected void buildInterpreter() { super.buildInterpreter(); Map<String, Object> omap = interpreter.getInterpretationContext().getObjectMap(); omap.put(ActionConst.APPENDER_BAG, new HashMap<String, Appender<IAccessEvent>>()); //omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap()); Map<String, String> propertiesMap = new HashMap<String, String>(); propertiesMap.putAll(parentPropertyMap); propertiesMap.put(key, value); interpreter.setInterpretationContextPropertiesMap(propertiesMap); }
@Test public void good() throws JoranException { simpleConfigurator.doConfigure(DEFINE_INPUT_DIR + GOOD_XML); InterpretationContext ic = simpleConfigurator.getInterpreter().getInterpretationContext(); String inContextFoo = ic.getProperty("foo"); assertEquals("monster", inContextFoo); }
/** * Builds a generic configuration-XML interpreter */ protected void buildInterpreter() { RuleStore rs = new SimpleRuleStore(context); addInstanceRules(rs); this.interpreter = new Interpreter(context, rs, initialElementPath()); InterpretationContext interpretationContext = interpreter.getInterpretationContext(); interpretationContext.setContext(context); addImplicitRules(interpreter); addDefaultNestedComponentRegistryRules(interpretationContext.getDefaultNestedComponentRegistry()); }
protected void buildInterpreter() { RuleStore rs = new SimpleRuleStore(context); addInstanceRules(rs); this.interpreter = new Interpreter(context, rs, initialPattern()); InterpretationContext ec = interpreter.getInterpretationContext(); ec.setContext(context); addImplicitRules(interpreter); addDefaultNestedComponentRegistryRules(ec.getDefaultNestedComponentRegistry()); }
@Override final public void doConfigure(final List<SaxEvent> eventList) throws JoranException { buildInterpreter(); interpreter.getInterpretationContext().pushObject(ff); EventPlayer player = new EventPlayer(interpreter); player.play(eventList); }