logback-android/src/main/java/ch/qos/logback/core/joran/action/ShutdownHookAction.java
@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);
        }
    }
@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.