public void start(LifeCycle lifeCycle) { if (lifeCycle instanceof ContextAware) { ((ContextAware) lifeCycle).setContext(this.context); } lifeCycle.start(); }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Mandatory \"" + CLASS_ATTRIBUTE + "\" attribute not set for <loggerContextListener> element"); inError = true; return; } try { lcl = (LoggerContextListener) OptionHelper.instantiateByClassName(className, LoggerContextListener.class, context); if (lcl instanceof ContextAware) { ((ContextAware) lcl).setContext(context); } ec.pushObject(lcl); addInfo("Adding LoggerContextListener of type [" + className + "] to the object stack"); } catch (Exception oops) { inError = true; addError("Could not create LoggerContextListener of type " + className + "].", oops); } }
public static <E> void setContextForConverters(Context context, Converter<E> head) { Converter<E> c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } } }
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); } }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Mandatory \"" + CLASS_ATTRIBUTE + "\" attribute not set for <loggerContextListener> element"); inError = true; return; } try { lcl = (LoggerContextListener) OptionHelper.instantiateByClassName( className, LoggerContextListener.class, context); if(lcl instanceof ContextAware) { ((ContextAware) lcl).setContext(context); } ec.pushObject(lcl); addInfo("Adding LoggerContextListener of type [" + className + "] to the object stack"); } catch (Exception oops) { inError = true; addError("Could not create LoggerContextListener of type " + className + "].", oops); } }
.setContext(this.context);
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 static <E> void setContextForConverters(Context context, Converter<E> head) { Converter<E> c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } } }
public static <E> void setContextForConverters(Context context, Converter<E> head) { Converter c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } } }
public static <E> void setContextForConverters(Context context, Converter<E> head) { Converter<E> c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } } }
public void start(LifeCycle lifeCycle) { if (lifeCycle instanceof ContextAware) { ((ContextAware) lifeCycle).setContext(this.context); } lifeCycle.start(); }
public static <E> void setContextForConverters(Context context, Converter<E> head) { Converter c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } } }
public static <E> void setContextForConverters(Context context, Converter<E> head) { Converter<E> c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } } }
public static <E> void setContextForConverters(Context context, Converter<E> head) { Converter<E> c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } } }
public static <E> void setContextForConverters(Context context, Converter<E> head) { Converter<E> c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } } }
protected void setContextForConverters(Converter<E> head) { Context context = getContext(); Converter c = head; while (c != null) { if (c instanceof ContextAware) { ((ContextAware) c).setContext(context); } c = c.getNext(); } }
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 } } }
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 } } }
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 } } }
@Before public void before() { contextAware.setContext(context); csl.setContext(context); bsm.clear(); }