tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session StandardSession.java
Date Mon, 14 May 2001 04:51:22 GMT
craigmcc    01/05/13 21:51:22

  Modified:    catalina/src/share/org/apache/catalina/connector
                        HttpRequestBase.java HttpResponseBase.java
                        RequestBase.java ResponseBase.java
               catalina/src/share/org/apache/catalina/core
                        StandardWrapper.java
               catalina/src/share/org/apache/catalina/session
                        StandardSession.java
  Log:
  Improve efficiency of the facades for requests, responses, sessions, and
  ServletConfig by recognizing that there is a 1:1 relationship between the
  facade objects and the implementation objects that they wrap.  Therefore,
  we can precreate the facades instead of instantiating them every time they
  are needed.
  
  Revision  Changes    Path
  1.24      +11 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java
  
  Index: HttpRequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- HttpRequestBase.java	2001/05/14 04:12:30	1.23
  +++ HttpRequestBase.java	2001/05/14 04:51:16	1.24
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
1.23 2001/05/14 04:12:30 remm Exp $
  - * $Revision: 1.23 $
  - * $Date: 2001/05/14 04:12:30 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
1.24 2001/05/14 04:51:16 craigmcc Exp $
  + * $Revision: 1.24 $
  + * $Date: 2001/05/14 04:51:16 $
    *
    * ====================================================================
    *
  @@ -101,7 +101,7 @@
    * be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.23 $ $Date: 2001/05/14 04:12:30 $
  + * @version $Revision: 1.24 $ $Date: 2001/05/14 04:51:16 $
    */
   
   public class HttpRequestBase
  @@ -148,6 +148,12 @@
   
   
       /**
  +     * The facade associated with this request.
  +     */
  +    protected HttpRequestFacade facade = new HttpRequestFacade(this);
  +
  +
  +    /**
        * The HTTP headers associated with this Request, keyed by name.  The
        * values are ArrayLists of the corresponding header values.
        */
  @@ -269,7 +275,7 @@
        */
       public ServletRequest getRequest() {
   
  -        return new HttpRequestFacade(this);
  +        return (facade);
   
       }
   
  
  
  
  1.32      +11 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java
  
  Index: HttpResponseBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- HttpResponseBase.java	2001/05/14 04:12:31	1.31
  +++ HttpResponseBase.java	2001/05/14 04:51:16	1.32
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
1.31 2001/05/14 04:12:31 remm Exp $
  - * $Revision: 1.31 $
  - * $Date: 2001/05/14 04:12:31 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
1.32 2001/05/14 04:51:16 craigmcc Exp $
  + * $Revision: 1.32 $
  + * $Date: 2001/05/14 04:51:16 $
    *
    * ====================================================================
    *
  @@ -100,7 +100,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.31 $ $Date: 2001/05/14 04:12:31 $
  + * @version $Revision: 1.32 $ $Date: 2001/05/14 04:51:16 $
    */
   
   public class HttpResponseBase
  @@ -128,6 +128,12 @@
   
   
       /**
  +     * The facade associated with this response.
  +     */
  +    protected HttpResponseFacade facade = new HttpResponseFacade(this);
  +
  +
  +    /**
        * The HTTP headers explicitly added via addHeader(), but not including
        * those to be added with setContentLength(), setContentType(), and so on.
        * This collection is keyed by the header name, and the elements are
  @@ -170,7 +176,7 @@
        */
       public ServletResponse getResponse() {
   
  -        return new HttpResponseFacade(this);
  +        return (facade);
   
       }
   
  
  
  
  1.13      +11 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java
  
  Index: RequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- RequestBase.java	2001/05/14 04:12:31	1.12
  +++ RequestBase.java	2001/05/14 04:51:17	1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
1.12 2001/05/14 04:12:31 remm Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/05/14 04:12:31 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
1.13 2001/05/14 04:51:17 craigmcc Exp $
  + * $Revision: 1.13 $
  + * $Date: 2001/05/14 04:51:17 $
    *
    * ====================================================================
    *
  @@ -98,7 +98,7 @@
    * the connector-specific methods need to be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.12 $ $Date: 2001/05/14 04:12:31 $
  + * @version $Revision: 1.13 $ $Date: 2001/05/14 04:51:17 $
    */
   
   public abstract class RequestBase
  @@ -157,6 +157,12 @@
   
   
       /**
  +     * The facade associated with this request.
  +     */
  +    protected RequestFacade facade = new RequestFacade(this);
  +
  +
  +    /**
        * Descriptive information about this Request implementation.
        */
       protected static final String info =
  @@ -345,7 +351,7 @@
        */
       public ServletRequest getRequest() {
   
  -	return new RequestFacade(this);
  +        return (facade);
   
       }
   
  
  
  
  1.13      +11 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java
  
  Index: ResponseBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ResponseBase.java	2001/05/14 04:12:32	1.12
  +++ ResponseBase.java	2001/05/14 04:51:17	1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v
1.12 2001/05/14 04:12:32 remm Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/05/14 04:12:32 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v
1.13 2001/05/14 04:51:17 craigmcc Exp $
  + * $Revision: 1.13 $
  + * $Date: 2001/05/14 04:51:17 $
    *
    * ====================================================================
    *
  @@ -88,7 +88,7 @@
    * the connector-specific methods need to be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.12 $ $Date: 2001/05/14 04:12:32 $
  + * @version $Revision: 1.13 $ $Date: 2001/05/14 04:51:17 $
    */
   
   public abstract class ResponseBase
  @@ -153,6 +153,12 @@
   
   
       /**
  +     * The facade associated with this response.
  +     */
  +    protected ResponseFacade facade = new ResponseFacade(this);
  +
  +
  +    /**
        * Are we currently processing inside a RequestDispatcher.include()?
        */
       protected boolean included = false;
  @@ -331,7 +337,7 @@
        */
       public ServletResponse getResponse() {
   
  -	return new ResponseFacade(this);
  +	return (facade);
   
       }
   
  
  
  
  1.24      +12 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java
  
  Index: StandardWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- StandardWrapper.java	2001/05/14 04:08:50	1.23
  +++ StandardWrapper.java	2001/05/14 04:51:19	1.24
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
1.23 2001/05/14 04:08:50 remm Exp $
  - * $Revision: 1.23 $
  - * $Date: 2001/05/14 04:08:50 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
1.24 2001/05/14 04:51:19 craigmcc Exp $
  + * $Revision: 1.24 $
  + * $Date: 2001/05/14 04:51:19 $
    *
    * ====================================================================
    *
  @@ -105,7 +105,7 @@
    * make them efficient are counter-productive.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.23 $ $Date: 2001/05/14 04:08:50 $
  + * @version $Revision: 1.24 $ $Date: 2001/05/14 04:51:19 $
    */
   
   public final class StandardWrapper
  @@ -152,6 +152,13 @@
   
   
       /**
  +     * The facade associated with this wrapper.
  +     */
  +    private StandardWrapperFacade facade =
  +        new StandardWrapperFacade(this);
  +
  +
  +    /**
        * The descriptive information string for this implementation.
        */
       private static final String info =
  @@ -823,7 +830,7 @@
   	    instanceSupport.fireInstanceEvent(InstanceEvent.BEFORE_INIT_EVENT,
   					      servlet);
               Thread.currentThread().setContextClassLoader(classLoader);
  -	    servlet.init(new StandardWrapperFacade(this));
  +	    servlet.init(facade);
   	    instanceSupport.fireInstanceEvent(InstanceEvent.AFTER_INIT_EVENT,
   					      servlet);
   	} catch (UnavailableException f) {
  
  
  
  1.19      +14 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java
  
  Index: StandardSession.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- StandardSession.java	2001/04/26 17:23:36	1.18
  +++ StandardSession.java	2001/05/14 04:51:21	1.19
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
1.18 2001/04/26 17:23:36 craigmcc Exp $
  - * $Revision: 1.18 $
  - * $Date: 2001/04/26 17:23:36 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
1.19 2001/05/14 04:51:21 craigmcc Exp $
  + * $Revision: 1.19 $
  + * $Date: 2001/05/14 04:51:21 $
    *
    * ====================================================================
    *
  @@ -111,7 +111,7 @@
    * @author Craig R. McClanahan
    * @author Sean Legassick
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
  - * @version $Revision: 1.18 $ $Date: 2001/04/26 17:23:36 $
  + * @version $Revision: 1.19 $ $Date: 2001/05/14 04:51:21 $
    */
   
   class StandardSession
  @@ -184,6 +184,13 @@
   
   
       /**
  +     * The facade associated with this session.  NOTE:  This value is not
  +     * included in the serialized version of this object.
  +     */
  +    private transient StandardSessionFacade facade = null;
  +
  +
  +    /**
        * The session identifier of this Session.
        */
       private String id = null;
  @@ -477,7 +484,9 @@
        */
       public HttpSession getSession() {
   
  -        return ((HttpSession) this);
  +        if (facade == null)
  +            facade = new StandardSessionFacade(this);
  +        return (facade);
   
       }
   
  
  
  

Mime
View raw message