All Packages Class Hierarchy This Package Previous Next Index
Interface org.apache.tomcat.core.ContextInterceptor
- public interface ContextInterceptor
Notifications for all context events.
Example: expand WAR, move files in the right directories ( Apache ?),
read web.xml or check for a serialized form for faster init, etc.
- Author:
- costin@dnt.ro
-
addContainer(Container)
- A new location was added to the server.
-
addContext(ContextManager, Context)
- Called when a context is added to a CM.
-
contextInit(Context)
- Notify when a context is initialized.
-
contextShutdown(Context)
- Called when a context is stoped, before removeContext.
-
engineInit(ContextManager)
- Called when the ContextManger is started.
-
engineShutdown(ContextManager)
- Called before the ContextManager is stoped.
-
postServletDestroy(Context, ServletWrapper)
-
-
postServletInit(Context, ServletWrapper)
-
-
preServletDestroy(Context, ServletWrapper)
- Servlet Destroy notification
-
preServletInit(Context, ServletWrapper)
- Servlet Init notification.
-
removeContainer(Container)
- A rule was removed, update the internal strucures.
-
removeContext(ContextManager, Context)
- Called when a context is removed from a CM.
engineInit
public abstract void engineInit(ContextManager cm) throws TomcatException
- Called when the ContextManger is started.
engineShutdown
public abstract void engineShutdown(ContextManager cm) throws TomcatException
- Called before the ContextManager is stoped.
You need to stop any threads and remove any resources.
addContext
public abstract void addContext(ContextManager cm,
Context ctx) throws TomcatException
- Called when a context is added to a CM. The context is probably not
initialized yet, only path and docRoot are probably set.
If you need informations that are available in web.xml use contextInit()
( a WebXmlReader needs to be the first interceptor in the contextInit chain ).
We do that to support ( eventualy ) a "lazy" init, where you have many contexts,
most of them not in active use, and you'll init them at first request. ( for
example an ISP with many users )
contextInit
public abstract void contextInit(Context ctx) throws TomcatException
- Notify when a context is initialized.
The first interceptor in the chain for contextInit must read web.xml and set
the context. When this method is called you can expect the context to be filled
in with all the informations from web.xml.
contextShutdown
public abstract void contextShutdown(Context ctx) throws TomcatException
- Called when a context is stoped, before removeContext. You must free all resources.
XXX - do we need this or removeContext is enough ?? ( will be removed from 3.1 if
nobody asks for it)
removeContext
public abstract void removeContext(ContextManager cm,
Context ctx) throws TomcatException
- Called when a context is removed from a CM. A context is removed either as
a result of admin ( remove or update), to support "clean" servlet reloading
or at shutdown.
addContainer
public abstract void addContainer(Container container) throws TomcatException
- A new location was added to the server. A location is defined as a set of
URL patterns with common properties. All servlet mappings and security
constraints are in this category - with a common handler and a common set
of authorized roles.
An interceptor interested in mapping must implement this method
and construct it's internal representation. The mapper is _required_
to find the Container associated with a request using the mapping
rules defined in the Servlet API.
The interceptor must also take care of "merging" parent with child containers.
It is possible that this method will be called several times for the same
url pattern ( for example to define a handler and then security constraints),
the interceptor needs to merge the 2 containers.
XXX define "merging" of containers
removeContainer
public abstract void removeContainer(Container container) throws TomcatException
- A rule was removed, update the internal strucures. You can also clean up
and reload everything using Context.getContainers()
preServletInit
public abstract void preServletInit(Context ctx,
ServletWrapper sw) throws TomcatException
- Servlet Init notification.
XXX do we need "pre/post" for init/destroy ? transactions?
postServletInit
public abstract void postServletInit(Context ctx,
ServletWrapper sw) throws TomcatException
preServletDestroy
public abstract void preServletDestroy(Context ctx,
ServletWrapper sw) throws TomcatException
- Servlet Destroy notification
postServletDestroy
public abstract void postServletDestroy(Context ctx,
ServletWrapper sw) throws TomcatException
All Packages Class Hierarchy This Package Previous Next Index