/** * 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); } }
hook.setContext(context);
/** * 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); } }
/** * 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); } }