|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.conf.WebApplicationListener
WebApplicationContextFilter
is the
official configuration choice for Cayenne, however you can still use a
custom listener similar to WebApplicationListener if you want to.
public class WebApplicationListener
WebApplicationListener utilizes Servlet specification 2.3 features to react on webapplication container events inializing Cayenne.
It performs the following tasks:
CayenneWebappListener must be configured in web.xml
deployment
descriptor as a listener of context and session events:
<listener> <listener-class>org.apache.cayenne.conf.WebApplicationListener</listener-class> </listener>
Note that to set WebApplicationListener as a listener of web application events, you must use servlet containers compatible with Servlet Specification 2.3 (such as Tomcat 4.0). Listeners were only added to servlet specification in 2.3. If you are using an older container, you will need to configure Cayenne in your code.
Constructor Summary | |
---|---|
WebApplicationListener()
Deprecated. |
Method Summary | |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce)
Deprecated. Currently does nothing. |
void |
contextInitialized(javax.servlet.ServletContextEvent sce)
Deprecated. Establishes a Cayenne shared Configuration object that can later be obtained by calling Configuration.getSharedConfiguration() . |
protected Configuration |
getConfiguration()
Deprecated. Returns the current configuration. |
protected Configuration |
newConfiguration(javax.servlet.ServletContext sc)
Deprecated. since 1.2 |
void |
sessionCreated(javax.servlet.http.HttpSessionEvent se)
Deprecated. Creates and assigns a new data context based on default domain to the session object associated with this event. |
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
Deprecated. Does nothing. |
protected void |
setConfiguration(Configuration configuration)
Deprecated. Initializes the configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebApplicationListener()
Method Detail |
---|
public void contextInitialized(javax.servlet.ServletContextEvent sce)
Configuration.getSharedConfiguration()
. This method is a
part of ServletContextListener interface and is called on application startup.
contextInitialized
in interface javax.servlet.ServletContextListener
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
contextDestroyed
in interface javax.servlet.ServletContextListener
public void sessionCreated(javax.servlet.http.HttpSessionEvent se)
sessionCreated
in interface javax.servlet.http.HttpSessionListener
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
sessionDestroyed
in interface javax.servlet.http.HttpSessionListener
protected Configuration newConfiguration(javax.servlet.ServletContext sc)
protected void setConfiguration(Configuration configuration)
protected Configuration getConfiguration()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |