public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for statusListener. Near [" + name + "] line " + getLineNumber(ec)); inError = true; return; } try { statusListener = (StatusListener) OptionHelper.instantiateByClassName( className, StatusListener.class, context); ec.getContext().getStatusManager().add(statusListener); if (statusListener instanceof ContextAware) { ((ContextAware) statusListener).setContext(context); } addInfo("Added status listener of type [" + className + "]"); ec.pushObject(statusListener); } catch (Exception e) { inError = true; addError( "Could not create an StatusListener of type [" + className + "].", e); throw new ActionException(e); } }
public void end(InterpretationContext ec, String e) { if (inError) { return; } if (isEffectivelyAdded() && 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(); } }
@Override protected void addInstanceRules(RuleStore rs) { // is "configuration/variable" referenced in the docs? rs.addRule(new ElementSelector("configuration/variable"), new PropertyAction()); rs.addRule(new ElementSelector("configuration/property"), new PropertyAction()); rs.addRule(new ElementSelector("configuration/substitutionProperty"), new PropertyAction()); rs.addRule(new ElementSelector("configuration/timestamp"), new TimestampAction()); rs.addRule(new ElementSelector("configuration/define"), new DefinePropertyAction()); // the contextProperty pattern is deprecated. It is undocumented // and will be dropped in future versions of logback rs.addRule(new ElementSelector("configuration/contextProperty"), new ContextPropertyAction()); rs.addRule(new ElementSelector("configuration/conversionRule"), new ConversionRuleAction()); rs.addRule(new ElementSelector("configuration/statusListener"), new StatusListenerAction()); rs.addRule(new ElementSelector("configuration/appender"), new AppenderAction()); rs.addRule(new ElementSelector("configuration/appender/appender-ref"), new AppenderRefAction()); rs.addRule(new ElementSelector("configuration/newRule"), new NewRuleAction()); rs.addRule(new ElementSelector("*/param"), new ParamAction()); }
public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if(OptionHelper.isEmpty(className)) { addError( "Missing class name for statusListener. Near [" + name + "] line " + getLineNumber(ec)); inError = true; return; } try { statusListener = (StatusListener) OptionHelper.instantiateByClassName( className, StatusListener.class, context); ec.getContext().getStatusManager().add(statusListener); ec.pushObject(statusListener); } catch (Exception e) { inError = true; addError( "Could not create an StatusListener of type ["+className+"].", e); throw new ActionException(e); } }
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(); } } }
@Override protected void addInstanceRules(RuleStore rs) { rs.addRule(new ElementSelector("configuration/property"), new PropertyAction()); rs.addRule(new ElementSelector("configuration/substitutionProperty"), new PropertyAction()); rs.addRule(new ElementSelector("configuration/timestamp"), new TimestampAction()); rs.addRule(new ElementSelector("configuration/shutdownHook"), new ShutdownHookAction()); rs.addRule(new ElementSelector("configuration/define"), new DefinePropertyAction()); rs.addRule(new ElementSelector("configuration/conversionRule"), new ConversionRuleAction()); rs.addRule(new ElementSelector("configuration/statusListener"), new StatusListenerAction()); rs.addRule(new ElementSelector("configuration/appender"), new AppenderAction<E>()); rs.addRule(new ElementSelector("configuration/appender/appender-ref"), new AppenderRefAction<E>()); rs.addRule(new ElementSelector("configuration/newRule"), new NewRuleAction()); rs.addRule(new ElementSelector("*/param"), new ParamAction()); }
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(); } } }
public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; effectivelyAdded = null; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for statusListener. Near [" + name + "] line " + getLineNumber(ec)); inError = true; return; } try { statusListener = (StatusListener) OptionHelper.instantiateByClassName(className, StatusListener.class, context); effectivelyAdded = ec.getContext().getStatusManager().add(statusListener); if (statusListener instanceof ContextAware) { ((ContextAware) statusListener).setContext(context); } addInfo("Added status listener of type [" + className + "]"); ec.pushObject(statusListener); } catch (Exception e) { inError = true; addError("Could not create an StatusListener of type [" + className + "].", e); throw new ActionException(e); } }
@Override protected void addInstanceRules(RuleStore rs) { rs.addRule(new Pattern("configuration/property"), new PropertyAction()); rs.addRule(new Pattern("configuration/substitutionProperty"), new PropertyAction()); rs.addRule(new Pattern("configuration/timestamp"), new TimestampAction()); // the contextProperty pattern is deprecated. It is undocumented // and will be dropped in future versions of logback rs.addRule(new Pattern("configuration/contextProperty"), new ContextPropertyAction()); rs.addRule(new Pattern("configuration/conversionRule"), new ConversionRuleAction()); rs.addRule(new Pattern("configuration/statusListener"), new StatusListenerAction()); rs.addRule(new Pattern("configuration/appender"), new AppenderAction()); rs.addRule(new Pattern("configuration/appender/appender-ref"), new AppenderRefAction()); rs.addRule(new Pattern("configuration/newRule"), new NewRuleAction()); rs.addRule(new Pattern("*/param"), new ParamAction()); }
public void end(InterpretationContext ec, String e) { if (inError) { return; } if (isEffectivelyAdded() && 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(); } }
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(); } } }
public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; effectivelyAdded = null; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for statusListener. Near [" + name + "] line " + getLineNumber(ec)); inError = true; return; } try { statusListener = (StatusListener) OptionHelper.instantiateByClassName(className, StatusListener.class, context); effectivelyAdded = ec.getContext().getStatusManager().add(statusListener); if (statusListener instanceof ContextAware) { ((ContextAware) statusListener).setContext(context); } addInfo("Added status listener of type [" + className + "]"); ec.pushObject(statusListener); } catch (Exception e) { inError = true; addError("Could not create an StatusListener of type [" + className + "].", e); throw new ActionException(e); } }
@Override protected void addInstanceRules(RuleStore rs) { rs.addRule(new Pattern("configuration/variable"), new PropertyAction()); rs.addRule(new Pattern("configuration/property"), new PropertyAction()); rs.addRule(new Pattern("configuration/substitutionProperty"), new PropertyAction()); rs.addRule(new Pattern("configuration/timestamp"), new TimestampAction()); rs.addRule(new Pattern("configuration/define"), new DefinePropertyAction()); // the contextProperty pattern is deprecated. It is undocumented // and will be dropped in future versions of logback rs.addRule(new Pattern("configuration/contextProperty"), new ContextPropertyAction()); rs.addRule(new Pattern("configuration/conversionRule"), new ConversionRuleAction()); rs.addRule(new Pattern("configuration/statusListener"), new StatusListenerAction()); rs.addRule(new Pattern("configuration/appender"), new AppenderAction()); rs.addRule(new Pattern("configuration/appender/appender-ref"), new AppenderRefAction()); rs.addRule(new Pattern("configuration/newRule"), new NewRuleAction()); rs.addRule(new Pattern("*/param"), new ParamAction()); }
public void end(InterpretationContext ec, String e) { if (inError) { return; } if (isEffectivelyAdded() && 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(); } }
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(); } } }
public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for statusListener. Near [" + name + "] line " + getLineNumber(ec)); inError = true; return; } try { statusListener = (StatusListener) OptionHelper.instantiateByClassName( className, StatusListener.class, context); ec.getContext().getStatusManager().add(statusListener); if (statusListener instanceof ContextAware) { ((ContextAware) statusListener).setContext(context); } addInfo("Added status listener of type [" + className + "]"); ec.pushObject(statusListener); } catch (Exception e) { inError = true; addError( "Could not create an StatusListener of type [" + className + "].", e); throw new ActionException(e); } }
@Override protected void addInstanceRules(RuleStore rs) { rs.addRule(new Pattern("configuration/variable"), new PropertyAction()); rs.addRule(new Pattern("configuration/property"), new PropertyAction()); rs.addRule(new Pattern("configuration/substitutionProperty"), new PropertyAction()); rs.addRule(new Pattern("configuration/timestamp"), new TimestampAction()); rs.addRule(new Pattern("configuration/define"), new DefinePropertyAction()); // the contextProperty pattern is deprecated. It is undocumented // and will be dropped in future versions of logback rs.addRule(new Pattern("configuration/contextProperty"), new ContextPropertyAction()); rs.addRule(new Pattern("configuration/conversionRule"), new ConversionRuleAction()); rs.addRule(new Pattern("configuration/statusListener"), new StatusListenerAction()); rs.addRule(new Pattern("configuration/appender"), new AppenderAction()); rs.addRule(new Pattern("configuration/appender/appender-ref"), new AppenderRefAction()); rs.addRule(new Pattern("configuration/newRule"), new NewRuleAction()); rs.addRule(new Pattern("*/param"), new ParamAction()); }
public void end(InterpretationContext ec, String e) { if (inError) { return; } if (isEffectivelyAdded() && 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(); } }
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(); } } }
public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; effectivelyAdded = null; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for statusListener. Near [" + name + "] line " + getLineNumber(ec)); inError = true; return; } try { statusListener = (StatusListener) OptionHelper.instantiateByClassName(className, StatusListener.class, context); effectivelyAdded = ec.getContext().getStatusManager().add(statusListener); if (statusListener instanceof ContextAware) { ((ContextAware) statusListener).setContext(context); } addInfo("Added status listener of type [" + className + "]"); ec.pushObject(statusListener); } catch (Exception e) { inError = true; addError("Could not create an StatusListener of type [" + className + "].", e); throw new ActionException(e); } }