tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http BaseRequest.java
Date Tue, 26 Jun 2001 19:38:13 GMT
costin      01/06/26 12:38:13

  Modified:    util/java/org/apache/tomcat/util/http BaseRequest.java
  Log:
  Added the jvmRoute ( renamed to tomcatInstanceId ) to the BaseRequest.
  We expect all implementations to be able to participate in load balancing,
  and the instanceId ( that identifies one of the workers in the pool ) is
  common enough ( even if a different scheme is used ).
  
  Revision  Changes    Path
  1.3       +20 -1     jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/BaseRequest.java
  
  Index: BaseRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/BaseRequest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BaseRequest.java	2001/06/25 15:53:27	1.2
  +++ BaseRequest.java	2001/06/26 19:38:12	1.3
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: Base http request object.                                  *
    * Author:      Keving Seguin [seguin@apache.org]                          *
  - * Version:     $Revision: 1.2 $                                           *
  + * Version:     $Revision: 1.3 $                                           *
    ***************************************************************************/
   
   package org.apache.tomcat.util.http;
  @@ -99,6 +99,8 @@
       MimeHeaders headers = new MimeHeaders();
       Cookies cookies = new Cookies();
       HashMap attributes = new HashMap();
  +
  +    MessageBytes tomcatInstanceId = new MessageBytes();
       
       /**
        * Recycles this object and readies it further use.
  @@ -121,6 +123,7 @@
           headers.recycle();
           cookies.recycle();
           attributes.clear();
  +        tomcatInstanceId.recycle();
       }
   
       /**
  @@ -317,6 +320,21 @@
       }
   
       /**
  +     * Get the host id ( or jvmRoute )
  +     * @return the jvm route
  +     */
  +    public MessageBytes instanceId() {
  +        return tomcatInstanceId;
  +    }
  +
  +    // backward compat - jvmRoute is the id of this tomcat instance,
  +    // used by a load balancer on the server side to implement sticky
  +    // sessions, and on the tomcat side to format the session ids.
  +    public MessageBytes jvmRoute() {
  +        return tomcatInstanceId;
  +    }
  +    
  +    /**
        * ** SLOW ** for debugging only!
        */
       public String toString() {
  @@ -341,6 +359,7 @@
           pw.println("attributes      = " + attributes.toString());
           pw.println("headers         = " + headers.toString());
           pw.println("cookies         = " + cookies.toString());
  +        pw.println("jvmRoute        = " + tomcatInstanceId.toString());
           return sw.toString();
       }
       
  
  
  

Mime
View raw message