Hi,

I would to add a feature: Allow jvmRoute to be a system property.

I have several Tomcat's using the same server.xml but I need a different sessionId for each Tomcat. The easy solution I have found is to use jmvRoute="SYSTEM" and read the system property "jmvRoute" to have the jvmRoute I want.
I have enclosed the corresponding patch.

Should I commit it?

Cheers

Jean-frederic
Index: catalina/src/share/org/apache/catalina/core/StandardEngine.java
===================================================================
RCS file: 
/home/cvs/mirror/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardEngine.java,v
retrieving revision 1.15
diff -u -r1.15 StandardEngine.java
--- catalina/src/share/org/apache/catalina/core/StandardEngine.java     2 May 2002 
22:14:45 -0000       1.15
+++ catalina/src/share/org/apache/catalina/core/StandardEngine.java     9 Dec 2002 
+08:56:06 -0000
@@ -171,6 +171,7 @@
      */
     public void setDefaultHost(String host) {
 
+        this.log("setDefaultHost=" + host);
         String oldDefaultHost = this.defaultHost;
         if (host == null) {
             this.defaultHost = null;
@@ -191,7 +192,16 @@
      */
     public void setJvmRoute(String routeId) {
         this.log("setJvmRoute=" + routeId);
-        jvmRouteId = routeId;
+        jvmRouteId = null;
+        if ("SYSTEM".equals(routeId))
+           this.log("setJvmRoute is SYSTEM!!!");
+            try {
+                jvmRouteId = System.getProperty("jvmRoute");
+                this.log("setJvmRoute read:" + jvmRouteId);
+            } catch(Exception ex) {
+            }
+        if (jvmRouteId == null)
+            jvmRouteId = routeId;
     }
 
 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to