tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request SimpleMapper.java
Date Wed, 16 Feb 2000 05:53:34 GMT
costin      00/02/15 21:53:34

  Modified:    src/share/org/apache/tomcat/context LogEvents.java
               src/share/org/apache/tomcat/core BaseInterceptor.java
                        RequestInterceptor.java
               src/share/org/apache/tomcat/request SimpleMapper.java
  Log:
  Added few more comments to RequestInterceptor, small changes.
  
  Revision  Changes    Path
  1.3       +0 -4      jakarta-tomcat/src/share/org/apache/tomcat/context/LogEvents.java
  
  Index: LogEvents.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/LogEvents.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LogEvents.java	2000/02/14 04:59:38	1.2
  +++ LogEvents.java	2000/02/16 05:53:32	1.3
  @@ -110,10 +110,6 @@
   	return 0;
       }
   
  -    public Enumeration getMethods()  {
  -	return methods.elements();
  -    }
  -
       // -------------------- Context notifications --------------------
       public void contextInit(Context ctx) throws TomcatException {
   	ctx.log( "Context Init ");
  
  
  
  1.7       +3 -3      jakarta-tomcat/src/share/org/apache/tomcat/core/BaseInterceptor.java
  
  Index: BaseInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/BaseInterceptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BaseInterceptor.java	2000/02/16 05:44:33	1.6
  +++ BaseInterceptor.java	2000/02/16 05:53:33	1.7
  @@ -71,7 +71,7 @@
    */
   public class BaseInterceptor implements RequestInterceptor, ContextInterceptor {
       ContextManager cm; 
  -    protected Vector methods=new Vector();
  +    protected String methods[]=new String[0];
       
       public BaseInterceptor() {
       }
  @@ -119,8 +119,8 @@
   	return 0;
       }
   
  -    public Enumeration getMethods()  {
  -	return methods.elements();
  +    public String []getMethods()  {
  +	return methods;
       }
   
       // -------------------- Context notifications --------------------
  
  
  
  1.8       +32 -13    jakarta-tomcat/src/share/org/apache/tomcat/core/RequestInterceptor.java
  
  Index: RequestInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestInterceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RequestInterceptor.java	2000/02/16 00:30:29	1.7
  +++ RequestInterceptor.java	2000/02/16 05:53:33	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestInterceptor.java,v
1.7 2000/02/16 00:30:29 costin Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/02/16 00:30:29 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestInterceptor.java,v
1.8 2000/02/16 05:53:33 costin Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/02/16 05:53:33 $
    *
    * ====================================================================
    *
  @@ -67,33 +67,36 @@
   import java.util.*;
   
   /**
  - * For request processing - before calling service() ( or any LifecycleInterceptors )
  + * Provide a mechanism to customize the request processing.
    *
    * @author costin@dnt.ro
    */
   public interface RequestInterceptor {
       public static final int OK=0;
   
  -    /** Will return the methods fow which this interceptor is interested
  -     *  in notification.
  -     */
  -    public Enumeration getMethods();
  -    
       /** 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).
        */
       public int contextMap(Request request);
   
  -    /** Handle mapping inside a context
  +    
  +    /** Handle mappings inside a context.
  +     *  You are required to respect the mappings in web.xml.
        */
       public int requestMap(Request request);
   
  +    
       /** Will extract the user ID from the request, and check the password.
        *  It will set the user only if the user/password are correct, or user
        *  will be null.
  +     *  XXX what should we do if the password is wrong ? 
        */
       public int authenticate(Request request, Response response);
   
  +
       /** Will check if the user is authorized, by checking if it is in one
        *  of the roles defined in security constraints.
        *
  @@ -105,29 +108,45 @@
        *  
        */
       public int authorize(Request request, Response response);
  +
   
  -    /** Called before service method is invoked.
  +    /** Called before service method is invoked. 
        */
       public int preService(Request request, Response response);
   
  +    
       /** Called before the first body write, and before sending
        *  the headers. The interceptor have a chance to change the
        *  output headers.
        */
       public int beforeBody( Request request, Response response);
  -        
  +
  +    
       /** Called before the output buffer is commited
        */
       public int beforeCommit( Request request, Response response);
   
  +    
       /** Called after the output stream is closed ( either by servlet
        *  or automatically at end of service )
        */
       public int afterBody( Request request, Response response);
   
  -    /** Called after service method ends. Log is a particular case
  +    
  +    /** Called after service method ends. Log is a particular use
        */
       public int postService(Request request, Response response);
  +
  +
  +    /** Will return the methods fow which this interceptor is interested
  +     *  in notification.
  +     *  This will be used by ContextManager to call only the interceptors
  +     *  that are interested, avoiding empty calls.
  +     *  ( not implemented yet )
  +     */
  +    public String[] getMethods();
  +
  +    
   
   }
   
  
  
  
  1.12      +0 -2      jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper.java
  
  Index: SimpleMapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SimpleMapper.java	2000/02/16 05:44:35	1.11
  +++ SimpleMapper.java	2000/02/16 05:53:33	1.12
  @@ -91,8 +91,6 @@
   
       
       public SimpleMapper() {
  -	methods.addElement("contextMap");
  -	methods.addElement("requestMap");	
       }
   
       public void setContextManager( ContextManager cm ) {
  
  
  

Mime
View raw message