|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.examples.mailreader.ApplicationListener
public final class ApplicationListener
ServletContextListener
that initializes and finalizes the
persistent storage of User and Subscription information for the Struts
Demonstration Application, using an in-memory database backed by an
XML file.
IMPLEMENTATION WARNING - If this web application is run from a WAR file, or in another environment where reading and writing of the web application resource is impossible, the initial contents will be copied to a file in the web application temporary directory provided by the container. This is for demonstration purposes only - you should NOT assume that files written here will survive a restart of your servlet container.
Field Summary | |
---|---|
static String |
DATABASE_KEY
Appication scope attribute key under which the in-memory version of our database is stored. |
static String |
PROTOCOLS_KEY
Application scope attribute key under which the valid selection items for the protocol property is stored. |
Constructor Summary | |
---|---|
ApplicationListener()
|
Method Summary | |
---|---|
void |
contextDestroyed(ServletContextEvent event)
Gracefully shut down this database, releasing any resources that were allocated at initialization. |
void |
contextInitialized(ServletContextEvent event)
Initialize and load our initial database from persistent storage. |
String |
getPathname()
|
void |
setPathname(String pathname)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DATABASE_KEY
Appication scope attribute key under which the in-memory version of our database is stored.
public static final String PROTOCOLS_KEY
Application scope attribute key under which the valid selection items for the protocol property is stored.
Constructor Detail |
---|
public ApplicationListener()
Method Detail |
---|
public String getPathname()
public void setPathname(String pathname)
public void contextDestroyed(ServletContextEvent event)
Gracefully shut down this database, releasing any resources that were allocated at initialization.
contextDestroyed
in interface ServletContextListener
event
- ServletContextEvent to processpublic void contextInitialized(ServletContextEvent event)
Initialize and load our initial database from persistent storage.
contextInitialized
in interface ServletContextListener
event
- The context initialization event
ServletException
- if we cannot configure ourselves correctly
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |