/* $This file is distributed under the terms of the license in /doc/license.txt$ */

package edu.cornell.mannlib.vitro.webapp.servlet.setup;

import javax.servlet.ServletContext;

public class AbortStartup {

    private static final String ATTRIBUTE_NAME = AbortStartup.class.getName();
    
    /**
     * Sets a context attribute to prevent other context listeners from running.
     */
    public static void abortStartup(ServletContext context) {
        context.setAttribute(ATTRIBUTE_NAME, new Boolean(true));
    }
    
    /**
     * Checks whether a previous context listener has caused startup to be aborted.
     */
    public static boolean isStartupAborted(ServletContext context) {
        return (context.getAttribute(ATTRIBUTE_NAME) != null);
    }
    
}

@@ -173,16 +173,566 @@
 ntext;%0A%0A
+/**%0A * Provide a mechanism so a ServletContextListener can set a flag that tells%0A * other ServletContextListeners not to run.%0A * %0A * The listener that detects a problem should still throw an exception, so%0A * Tomcat will declare that the startup has failed and mark the application as%0A * not runnable. However, Tomcat will still run the other listeners before%0A * giving up. Hence, the need for this flag.%0A * %0A * If the other listeners are looking for this flag, they can (and should)%0A * decide to simply exit rather than attempting to initialize.%0A */%0A
 public c

Add a comment for the slow learners like me.