tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session ManagerBase.java
Date Thu, 17 Jan 2002 12:11:59 GMT
remm        02/01/17 04:11:59

  Modified:    catalina/src/share/org/apache/catalina/session Tag:
                        tomcat_40_branch ManagerBase.java
  Log:
  - Port JVM route addition.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.2   +39 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/ManagerBase.java
  
  Index: ManagerBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/ManagerBase.java,v
  retrieving revision 1.9.2.1
  retrieving revision 1.9.2.2
  diff -u -r1.9.2.1 -r1.9.2.2
  --- ManagerBase.java	10 Dec 2001 01:26:48 -0000	1.9.2.1
  +++ ManagerBase.java	17 Jan 2002 12:11:59 -0000	1.9.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/ManagerBase.java,v
1.9.2.1 2001/12/10 01:26:48 craigmcc Exp $
  - * $Revision: 1.9.2.1 $
  - * $Date: 2001/12/10 01:26:48 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/ManagerBase.java,v
1.9.2.2 2002/01/17 12:11:59 remm Exp $
  + * $Revision: 1.9.2.2 $
  + * $Date: 2002/01/17 12:11:59 $
    *
    * ====================================================================
    *
  @@ -74,6 +74,7 @@
   import java.util.HashMap;
   import java.util.Random;
   import org.apache.catalina.Container;
  +import org.apache.catalina.Engine;
   import org.apache.catalina.Logger;
   import org.apache.catalina.Manager;
   import org.apache.catalina.Session;
  @@ -86,7 +87,7 @@
    * be subclassed to create more sophisticated Manager implementations.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.9.2.1 $ $Date: 2001/12/10 01:26:48 $
  + * @version $Revision: 1.9.2.2 $ $Date: 2002/01/17 12:11:59 $
    */
   
   public abstract class ManagerBase implements Manager {
  @@ -547,6 +548,12 @@
           session.setCreationTime(System.currentTimeMillis());
           session.setMaxInactiveInterval(this.maxInactiveInterval);
           String sessionId = generateSessionId();
  +        String jvmRoute = getJvmRoute();
  +        // @todo Move appending of jvmRoute generateSessionId()???
  +        if (jvmRoute != null) {
  +            sessionId += '.' + jvmRoute;
  +            session.setId(sessionId);
  +        }
           /*
           synchronized (sessions) {
               while (sessions.get(sessionId) != null)        // Guarantee uniqueness
  @@ -655,6 +662,34 @@
           }
           return (result.toString());
   
  +    }
  +
  +
  +    /**
  +     * Retrieve the enclosing Engine for this Manager.
  +     *
  +     * @return an Engine object (or null).
  +     */
  +    protected Engine getEngine() {
  +        Engine e = null;
  +        for (Container c=getContainer(); e == null && c != null ;
  +             c = c.getParent()) {
  +            if (c != null && c instanceof Engine) {
  +                e = (Engine)c;
  +            }
  +        }
  +        return e;
  +    }
  +
  +
  +    /**
  +     * Retrieve the JvmRoute for the enclosing Engine.
  +     * 
  +     * @return the JvmRoute or null.
  +     */
  +    protected String getJvmRoute() {
  +        Engine e = getEngine();
  +        return e == null ? null : e.getJvmRoute();
       }
   
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message