Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tomcat.facade
Class Servlet22Interceptor

    java.lang.Object
      org.apache.tomcat.core.BaseInterceptor
          org.apache.tomcat.facade.Servlet22Interceptor

public final class Servlet22Interceptor
extends BaseInterceptor

Control class for facades - this is the only "gate" between servlets and tomcat. This is an important security component, shouldn't be used for anything else. Please keep all the code short and clean - and review everything very often.

Field Summary
`static java.lang.String` | `SERVLET_STAMP`

Fields inherited from class org.apache.tomcat.core.BaseInterceptor
`cm, ct, ctx, debug, DECLINED, loghelper, OK`

Constructor Summary
`Servlet22Interceptor()`
`Servlet22Interceptor(Context ctx)`

Method Summary
`void` | `addContainer(Container ct)` Notify that certain properties are defined for a URL pattern.
`void` | `addContext(ContextManager cm, Context ctx)` Called when a context is added to a CM.
`void` | `contextShutdown(Context ctx)` Call servlet.destroy() for all servlets, as required by the spec
`int` | `postRequest(Request rreq, Response rres)` Experimental hook: called after the request is finished, before returning to the caller.
`int` | `sessionState(Request req, ServerSession sess, int newState)` Call the Servlet22 callbacks when session expires.
`void` | `setSTMPoolSize(int size)`
`void` | `setUseSTMPool(boolean use)`

Methods inherited from class org.apache.tomcat.core.BaseInterceptor
`addHandler, addInterceptor, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextInit, contextMap, contextState, copyContext, engineInit, engineShutdown, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postInitCheck, postReadRequest, postService, postServletDestroy, postServletInit, preInitCheck, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, setContext, setContextManager, setDebug, setInfo, setNote, setNote`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SERVLET_STAMP

    public static final java.lang.String SERVLET_STAMP

See Also:
  Constant Field Values

Constructor Detail

### Servlet22Interceptor

    public Servlet22Interceptor()

### Servlet22Interceptor

    public Servlet22Interceptor(Context ctx)

Method Detail

### setSTMPoolSize

    public void setSTMPoolSize(int size)

### setUseSTMPool

    public void setUseSTMPool(boolean use)

### contextShutdown

    public void contextShutdown(Context ctx)
                         throws TomcatException

  Call servlet.destroy() for all servlets, as required by the spec

  Overrides:
    `contextShutdown` in class `BaseInterceptor`
  Throws:
    `TomcatException`

### addContext

    public void addContext(ContextManager cm,
                           Context ctx)
                    throws TomcatException

  Description copied from class: `BaseInterceptor`
  Called when a context is added to a CM. The context is probably not initialized yet, only path, docRoot, host, and properties set before adding the context ( in server.xml for example ) are available. At this stage mappers can start creating structures for the context ( the actual loading of the context may be delayed in future versions of tomcat until the first access ). DefaultCMSetter will also adjust the logger and paths based on context manager properties. Any activity that depends on web.xml must be done at init time.

  Overrides:
    `addContext` in class `BaseInterceptor`
  Throws:
    `TomcatException`

### addContainer

    public void addContainer(Container ct)
                      throws TomcatException

  Description copied from class: `BaseInterceptor`
  Notify that certain properties are defined for a URL pattern. Properties can be a "handler" that will be called for URLs matching the pattern or "security constraints" ( or any other properties that can be associated with URL patterns ) Interceptors will maintain their own mapping tables if they are interested in a certain property. General-purpose mapping code is provided in utils. The method will be called once for every properties associated with a URL - it's up to the interceptor to interpret the URL and deal with "merging". A Container that defines a servlet mapping ( handler ) will have the handlerName set to the name of the handler. The Handler ( getHandler) can be null for dynamically added servlets, and will be set by a facade interceptor. XXX We use this hook to create ServletWrappers for dynamically added servlets in InvokerInterceptor ( JspInterceptor is JDK1.2 specific ). It may be good to add a new hook specifically for that

  Overrides:
    `addContainer` in class `BaseInterceptor`
  Throws:
    `TomcatException`

### sessionState

    public int sessionState(Request req,
                            ServerSession sess,
                            int newState)

  Call the Servlet22 callbacks when session expires.

  Overrides:
    `sessionState` in class `BaseInterceptor`

### postRequest

    public int postRequest(Request rreq,
                           Response rres)

  Description copied from class: `BaseInterceptor`
  Experimental hook: called after the request is finished, before returning to the caller. This will be called only on the main request, and will give interceptors a chance to clean up - that would be difficult in postService, that is called after included servlets too. Don't use this hook until it's marked final, I added it to deal with recycle() in facades - if we find a better solution this can go. ( unless people find it useful

  Overrides:
    `postRequest` in class `BaseInterceptor`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Software Foundation. All Rights Reserved.