org.apache.tomcat.modules.loggers
Class AccountingInterceptor

java.lang.Object
  extended byorg.apache.tomcat.core.BaseInterceptor
      extended byorg.apache.tomcat.modules.loggers.AccountingInterceptor

public class AccountingInterceptor
extends BaseInterceptor

Time counting.


Field Summary
static int ACC_IN_OUT
           
static int ACC_OUT_COUNT
           
static int ACC_POST_MAP
           
static int ACC_POST_SERVICE
           
static int ACC_PRE_CMAP
           
static int ACC_PRE_RMAP
           
static int ACC_PRE_SERVICE
           
static int COUNTERS_COUNT
           
 
Fields inherited from class org.apache.tomcat.core.BaseInterceptor
ct, ctx, DECLINED, loghelper, OK
 
Constructor Summary
AccountingInterceptor()
           
 
Method Summary
 int afterBody(Request request, Response response)
          Called after the output stream is closed ( either by servlet or automatically at end of service ).
 int authenticate(Request request, Response response)
          This callback is used to extract and verify the user identity and credentials.
 int authorize(Request request, Response response)
           
 int beforeBody(Request rrequest, Response response)
          Called before the first body write, and before sending the headers.
 int beforeCommit(Request request, Response response)
          Called before the output buffer is commited.
 int contextMap(Request request)
          Will detect the context path for a request.
 void engineInit(ContextManager cm)
          Called when the ContextManger is started
 int postService(Request request, Response response)
          Called after service method ends.
 int preService(Request request, Response response)
          Called before service method is invoked.
 int requestMap(Request request)
          Handle mappings inside a context.
 void setTrace(java.lang.String file)
           
 
Methods inherited from class org.apache.tomcat.core.BaseInterceptor
addContainer, addContext, addHandler, addInterceptor, addSecurityConstraint, authorize, contextInit, contextShutdown, contextState, engineShutdown, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postReadRequest, postRequest, postServletDestroy, postServletInit, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, sessionState, 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

ACC_PRE_CMAP

public static final int ACC_PRE_CMAP
See Also:
Constant Field Values

ACC_PRE_RMAP

public static final int ACC_PRE_RMAP
See Also:
Constant Field Values

ACC_POST_MAP

public static final int ACC_POST_MAP
See Also:
Constant Field Values

ACC_PRE_SERVICE

public static final int ACC_PRE_SERVICE
See Also:
Constant Field Values

ACC_POST_SERVICE

public static final int ACC_POST_SERVICE
See Also:
Constant Field Values

ACC_IN_OUT

public static final int ACC_IN_OUT
See Also:
Constant Field Values

ACC_OUT_COUNT

public static final int ACC_OUT_COUNT
See Also:
Constant Field Values

COUNTERS_COUNT

public static final int COUNTERS_COUNT
See Also:
Constant Field Values
Constructor Detail

AccountingInterceptor

public AccountingInterceptor()
Method Detail

setTrace

public void setTrace(java.lang.String file)

engineInit

public void engineInit(ContextManager cm)
                throws TomcatException
Called when the ContextManger is started

Overrides:
engineInit in class BaseInterceptor
Throws:
TomcatException - The module will not be added if any exception is thrown by engineInit.

requestMap

public int requestMap(Request request)
Description copied from class: BaseInterceptor
Handle mappings inside a context. You are required to respect the mappings in web.xml.

Overrides:
requestMap in class BaseInterceptor

contextMap

public int contextMap(Request request)
Description copied from class: BaseInterceptor
Will detect the context path for a request. It need to set: context, contextPath, lookupPath A possible use for this would be a "user-home" interceptor that will implement ~costin servlets ( add and map them at run time).

Overrides:
contextMap in class BaseInterceptor

authenticate

public int authenticate(Request request,
                        Response response)
Description copied from class: BaseInterceptor
This callback is used to extract and verify the user identity and credentials. It will set the RemoteUser field if it can authenticate. The auth event is generated by a user asking for the remote user field of by tomcat if a request requires authenticated id.

Overrides:
authenticate in class BaseInterceptor

authorize

public int authorize(Request request,
                     Response response)

preService

public int preService(Request request,
                      Response response)
Description copied from class: BaseInterceptor
Called before service method is invoked.

Overrides:
preService in class BaseInterceptor

beforeBody

public int beforeBody(Request rrequest,
                      Response response)
Description copied from class: BaseInterceptor
Called before the first body write, and before sending the headers. The interceptor have a chance to change the output headers. Before body allows you do do various actions before the first byte of the response is sent. After all those callbacks are called tomcat may send the status and headers

Overrides:
beforeBody in class BaseInterceptor

beforeCommit

public int beforeCommit(Request request,
                        Response response)
Description copied from class: BaseInterceptor
Called before the output buffer is commited.

Overrides:
beforeCommit in class BaseInterceptor

afterBody

public int afterBody(Request request,
                     Response response)
Description copied from class: BaseInterceptor
Called after the output stream is closed ( either by servlet or automatically at end of service ). It is called after the servlet finished sending the response ( either closeing the stream or ending ). You can deal with connection reuse or do other actions

Overrides:
afterBody in class BaseInterceptor

postService

public int postService(Request request,
                       Response response)
Description copied from class: BaseInterceptor
Called after service method ends. Log is a particular use.

Overrides:
postService in class BaseInterceptor


Copyright © 2001 Apache Software Foundation. All Rights Reserved.