/** * Default method for stopping the Logback context */ protected void stop() { addInfo("Logback context being closed via shutdown hook"); Context hookContext = getContext(); if (hookContext instanceof ContextBase) { ContextBase context = (ContextBase) hookContext; context.stop(); } } }
public void run() { try { Thread.sleep(delay.getMilliseconds()); } catch (InterruptedException e) { } super.stop(); } }
/** * Instantiates a shutdown hook of the given class and sets its name. * * The hook thus generated is placed in the {@link InterpretationContext}'s * shutdown hook bag. */ @Override public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException { hook = null; inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { className = DefaultShutdownHook.class.getName(); addInfo("Assuming className [" + className + "]"); } try { addInfo("About to instantiate shutdown hook of type [" + className + "]"); hook = (ShutdownHookBase) OptionHelper.instantiateByClassName(className, ShutdownHookBase.class, context); hook.setContext(context); ic.pushObject(hook); }catch (Exception e) { inError = true; addError("Could not create a shutdown hook of type [" + className + "].", e); throw new ActionException(e); } }
/** * Instantiates a shutdown hook of the given class and sets its name. * * The hook thus generated is placed in the {@link InterpretationContext}'s * shutdown hook bag. */ @Override public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException { hook = null; inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for shutdown hook. Near [" + name + "] line " + getLineNumber(ic)); inError = true; return; } try { addInfo("About to instantiate shutdown hook of type [" + className + "]"); hook = (ShutdownHookBase) OptionHelper.instantiateByClassName(className, ShutdownHookBase.class, context); hook.setContext(context); ic.pushObject(hook); } catch (Exception e) { inError = true; addError("Could not create a shutdown hook of type [" + className + "].", e); throw new ActionException(e); } }
/** * Default method for stopping the Logback context */ protected void stop() { addInfo("Logback context being closed via shutdown hook"); Context hookContext = getContext(); if (hookContext instanceof ContextBase) { ContextBase context = (ContextBase) hookContext; context.stop(); } } }
public void run() { addInfo("Sleeping for "+delay); try { Thread.sleep(delay.getMilliseconds()); } catch (InterruptedException e) { } super.stop(); } }
/** * Instantiates a shutdown hook of the given class and sets its name. * * The hook thus generated is placed in the {@link InterpretationContext}'s * shutdown hook bag. */ @Override public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException { hook = null; inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for shutdown hook. Near [" + name + "] line " + getLineNumber(ic)); inError = true; return; } try { addInfo("About to instantiate shutdown hook of type [" + className + "]"); hook = (ShutdownHookBase) OptionHelper.instantiateByClassName(className, ShutdownHookBase.class, context); hook.setContext(context); ic.pushObject(hook); } catch (Exception e) { inError = true; addError("Could not create a shutdown hook of type [" + className + "].", e); throw new ActionException(e); } }
/** * Default method for stopping the Logback context */ protected void stop() { addInfo("Logback context being closed via shutdown hook"); Context hookContext = getContext(); if (hookContext instanceof ContextBase) { ContextBase context = (ContextBase) hookContext; context.stop(); } } }
public void run() { addInfo("Sleeping for "+delay); try { Thread.sleep(delay.getMilliseconds()); } catch (InterruptedException e) { } super.stop(); } }
/** * Instantiates a shutdown hook of the given class and sets its name. * * The hook thus generated is placed in the {@link InterpretationContext}'s * shutdown hook bag. */ @Override public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException { hook = null; inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for shutdown hook. Near [" + name + "] line " + getLineNumber(ic)); inError = true; return; } try { addInfo("About to instantiate shutdown hook of type [" + className + "]"); hook = (ShutdownHookBase) OptionHelper.instantiateByClassName(className, ShutdownHookBase.class, context); hook.setContext(context); ic.pushObject(hook); } catch (Exception e) { inError = true; addError("Could not create a shutdown hook of type [" + className + "].", e); throw new ActionException(e); } }
/** * Default method for stopping the Logback context */ protected void stop() { addInfo("Logback context being closed via shutdown hook"); Context hookContext = getContext(); if (hookContext instanceof ContextBase) { ContextBase context = (ContextBase) hookContext; context.stop(); } } }
public void run() { addInfo("Sleeping for "+delay); try { Thread.sleep(delay.getMilliseconds()); } catch (InterruptedException e) { } super.stop(); } }
hook.setContext(context);
/** * Default method for stopping the Logback context */ protected void stop() { addInfo("Logback context being closed via shutdown hook"); Context hookContext = getContext(); if (hookContext instanceof ContextBase) { ContextBase context = (ContextBase) hookContext; context.stop(); } } }
public void run() { if (delay.getMilliseconds() > 0) { addInfo("Sleeping for " + delay); try { Thread.sleep(delay.getMilliseconds()); } catch (InterruptedException e) { } } super.stop(); } }