Class StartupManager
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.startup.StartupManager
-
- All Implemented Interfaces:
EventListener,javax.servlet.ServletContextListener
public class StartupManager extends Object implements javax.servlet.ServletContextListener
Instantiate and run the ServletContextListeners for Vitro, while accumulating messages in StartupStatus. The startup listeners are stored in a file with one full-qualified class name per line. Blank lines and comment lines (starting with '#') are ignored. No exception in the listeners should prevent the successful completion. However, an uncaught exception or a fatal error status will cause the StartupStatusDisplayFilter to disply the problem instead of showing the home page (or any other requested page).
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILE_OF_STARTUP_LISTENERS
-
Constructor Summary
Constructors Constructor Description StartupManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextDestroyed(javax.servlet.ServletContextEvent sce)Notify the listeners that the context is being destroyed, in the reverse order from how they were notified at initialization.voidcontextInitialized(javax.servlet.ServletContextEvent sce)Build a list of the listeners, and run contextInitialized() on each of them, at least until we get a fatal error.
-
-
-
Field Detail
-
FILE_OF_STARTUP_LISTENERS
public static final String FILE_OF_STARTUP_LISTENERS
- See Also:
- Constant Field Values
-
-
Method Detail
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent sce)
Build a list of the listeners, and run contextInitialized() on each of them, at least until we get a fatal error. Each step of this should handle its own exceptions, but we'll wrap the whole thing in a try/catch just in case.- Specified by:
contextInitializedin interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
Notify the listeners that the context is being destroyed, in the reverse order from how they were notified at initialization.- Specified by:
contextDestroyedin interfacejavax.servlet.ServletContextListener
-
-