public class WebListener extends Object implements javax.servlet.ServletRequestListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextListener
WebFilter
in the web.xml
as below if you use Jaguar in Web environment:
<listener>
<listener-class>org.eiichiro.jaguar.WebListener</listener-class>
<!--
* or org.eiichiro.jaguar.WebListener extension class overriding
* WebListener#install()
method to install components on
* the application bootstrap.
-->
</listener>
and specify the Deployment
the application is running on like this (If no
deployment has been specified, the application is running on Production
deployment):
<context-param> <param-name>org.eiichiro.jaguar.deployment</param-name> <!-- Fully qualified deployment qualifier class name. --> <param-value>org.eiichiro.jaguar.deployment.Testing</param-value> </context-param>
Constructor and Description |
---|
WebListener() |
Modifier and Type | Method and Description |
---|---|
protected Collection<Class<?>> |
components(javax.servlet.ServletContext context)
Declare
WebListener subclass and override this method to specify
components to be install in bulk after the application bootstrap (Of course,
you can also install components from anywhere on the fly after the bootstrap). |
void |
contextDestroyed(javax.servlet.ServletContextEvent sce)
Shuts down the application in Web environment and deassociates the
current
ServletContext from Application context. |
void |
contextInitialized(javax.servlet.ServletContextEvent sce)
Bootstraps the application in Web environment on the specified deployment
(if specified in the web.xml) and associates the current
ServletContext
with Application context. |
protected Class<?> |
deployment(javax.servlet.ServletContext context)
Returns the deployment qualifier class specified at web.xml.
|
void |
requestDestroyed(javax.servlet.ServletRequestEvent sre)
Deassociates the current
ServletRequest from Request
context. |
void |
requestInitialized(javax.servlet.ServletRequestEvent sre)
Associates the current
ServletRequest with Request
context. |
void |
sessionCreated(javax.servlet.http.HttpSessionEvent se)
Associates the current
HttpSessionEvent with Session
context. |
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
Deassociates the current
HttpSessionEvent from Session
context. |
public void contextInitialized(javax.servlet.ServletContextEvent sce)
ServletContext
with Application
context.contextInitialized
in interface javax.servlet.ServletContextListener
sce
- The event the ServletContext
is initialized.protected Class<?> deployment(javax.servlet.ServletContext context)
null
.context
- ServletContext
of the current application.protected Collection<Class<?>> components(javax.servlet.ServletContext context)
WebListener
subclass and override this method to specify
components to be install in bulk after the application bootstrap (Of course,
you can also install components from anywhere on the fly after the bootstrap).
This method is invoked in #contextInitialized(ServletContextEvent)
,
right after the application bootstrap. Use Jaguar#install(Collection)
to install components.context
- ServletContext
of the current application.Jaguar.install(Collection)
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
ServletContext
from Application
context.contextDestroyed
in interface javax.servlet.ServletContextListener
sce
- The event the ServletContext
is destroyed.public void sessionCreated(javax.servlet.http.HttpSessionEvent se)
HttpSessionEvent
with Session
context.sessionCreated
in interface javax.servlet.http.HttpSessionListener
se
- The event the HttpSession
is created.public void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
HttpSessionEvent
from Session
context.sessionDestroyed
in interface javax.servlet.http.HttpSessionListener
se
- The event the HttpSession
is destroyed.public void requestInitialized(javax.servlet.ServletRequestEvent sre)
ServletRequest
with Request
context.requestInitialized
in interface javax.servlet.ServletRequestListener
sre
- The event the ServletRequest
is initialized.public void requestDestroyed(javax.servlet.ServletRequestEvent sre)
ServletRequest
from Request
context.requestDestroyed
in interface javax.servlet.ServletRequestListener
sre
- The event the ServletRequest
is destroyed.Copyright © 2011-2014 Eiichiro Uchiumi. All Rights Reserved.