public class ApplicationInitialization extends Object implements javax.servlet.ServletContextListener
| Constructor and Description |
|---|
ApplicationInitialization() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce)
Shutdown the database if it hasn't already been shutdown.
|
void |
contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
Find the application home (wmotables.home) and make sure it exists.
|
void |
createDatabase(String wmotablesHome,
String databaseSelected,
javax.servlet.ServletContext servletContext)
Creates a directory (and parent directories as needed) using the provided file.
|
void |
createDirectory(File file)
Creates a directory (and parent directories as needed) using the provided file.
|
public void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
contextInitialized in interface javax.servlet.ServletContextListenerservletContextEvent - The event class.public void contextDestroyed(javax.servlet.ServletContextEvent sce)
contextDestroyed in interface javax.servlet.ServletContextListenersce - The event class.public void createDirectory(File file) throws RuntimeException
file - The directory to create.RuntimeException - If we are unable to create the directory.public void createDatabase(String wmotablesHome, String databaseSelected, javax.servlet.ServletContext servletContext)
wmotablesHome - The value of wmotables.home.databaseSelected - The value of wmotables.db.Copyright © 1999–2013 UCAR/Unidata. All rights reserved.