Author: kfujino
Date: Tue Oct 14 06:08:49 2014
New Revision: 1631628

URL: http://svn.apache.org/r1631628
Log:
Add support for the SessionIdGenerator to cluster manager template.

Modified:
    tomcat/trunk/java/org/apache/catalina/ha/ClusterRuleSet.java
    tomcat/trunk/java/org/apache/catalina/ha/session/ClusterManagerBase.java
    tomcat/trunk/webapps/docs/changelog.xml
    tomcat/trunk/webapps/docs/config/cluster-manager.xml

Modified: tomcat/trunk/java/org/apache/catalina/ha/ClusterRuleSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/ClusterRuleSet.java?rev=1631628&r1=1631627&r2=1631628&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/ClusterRuleSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/ClusterRuleSet.java Tue Oct 14 
06:08:49 2014
@@ -91,7 +91,13 @@ public class ClusterRuleSet extends Rule
         digester.addSetNext(prefix + "Manager",
                             "setManagerTemplate",
                             "org.apache.catalina.ha.ClusterManager");
-
+        digester.addObjectCreate(prefix + "Manager/SessionIdGenerator",
+                "org.apache.catalina.util.StandardSessionIdGenerator",
+                "className");
+        digester.addSetProperties(prefix + "Manager/SessionIdGenerator");
+        digester.addSetNext(prefix + "Manager/SessionIdGenerator",
+               "setSessionIdGenerator",
+               "org.apache.catalina.SessionIdGenerator");
 
         digester.addObjectCreate(prefix + "Channel",
                                  null, // MUST be specified in the element

Modified: 
tomcat/trunk/java/org/apache/catalina/ha/session/ClusterManagerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/ClusterManagerBase.java?rev=1631628&r1=1631627&r2=1631628&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/ClusterManagerBase.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/ClusterManagerBase.java 
Tue Oct 14 06:08:49 2014
@@ -24,6 +24,7 @@ import org.apache.catalina.Cluster;
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.Loader;
+import org.apache.catalina.SessionIdGenerator;
 import org.apache.catalina.Valve;
 import org.apache.catalina.ha.CatalinaCluster;
 import org.apache.catalina.ha.ClusterManager;
@@ -199,6 +200,17 @@ public abstract class ClusterManagerBase
         copy.setSecureRandomClass(getSecureRandomClass());
         copy.setSecureRandomProvider(getSecureRandomProvider());
         copy.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
+        if (getSessionIdGenerator() != null) {
+            try {
+                SessionIdGenerator copyIdGenerator = 
sessionIdGeneratorClass.newInstance();
+                
copyIdGenerator.setSessionIdLength(getSessionIdGenerator().getSessionIdLength());
+                
copyIdGenerator.setJvmRoute(getSessionIdGenerator().getJvmRoute());
+                copy.setSessionIdGenerator(copyIdGenerator);
+            } catch (InstantiationException | IllegalAccessException e) {
+             // Ignore
+            }
+        }
+       
     }
 
     /**

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1631628&r1=1631627&r2=1631628&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Oct 14 06:08:49 2014
@@ -152,6 +152,14 @@
       </scode>
     </changelog>
   </subsection>
+  <subsection name="Cluster">
+    <changelog>
+      <fix>
+        Add support for the <code>SessionIdGenerator</code> to cluster manager
+        template. (kfujino)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="WebSocket">
     <changelog>
       <fix>

Modified: tomcat/trunk/webapps/docs/config/cluster-manager.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster-manager.xml?rev=1631628&r1=1631627&r2=1631628&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/cluster-manager.xml (original)
+++ tomcat/trunk/webapps/docs/config/cluster-manager.xml Tue Oct 14 06:08:49 
2014
@@ -226,5 +226,21 @@
     </attributes>
   </subsection>
 </section>
+<section name="Nested Components">
+  <h3>All Manager Implementations</h3>
+  <p>All Manager implementations allow nesting of a
+  <strong>&lt;SessionIdGenerator&gt;</strong> element. It defines
+  the behavior of session id generation.  All implementations
+  of the <a href="sessionidgenerator.html">SessionIdGenerator</a> allow the
+  following attributes:
+  </p>
+  <attributes>
+    <attribute name="sessionIdLength" required="false">
+      <p>The length of the session ID may be changed with the
+      <strong>sessionIdLength</strong> attribute.
+      </p>
+    </attribute>
+  </attributes>
+</section>  
 </body>
 </document>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to