Author: remy.maucherat(a)jboss.com
Date: 2010-11-25 12:00:03 -0500 (Thu, 25 Nov 2010)
New Revision: 1592
Modified:
trunk/java/org/apache/catalina/connector/Request.java
Log:
- Add an option to use the shared random.
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2010-11-25 11:24:57 UTC (rev
1591)
+++ trunk/java/org/apache/catalina/connector/Request.java 2010-11-25 17:00:03 UTC (rev
1592)
@@ -156,6 +156,10 @@
Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Request.USE_PRINCIPAL_FROM_SESSION",
"false")).booleanValue();
+ protected static final boolean LOCAL_RANDOM =
+
Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Request.LOCAL_RANDOM",
"true")).booleanValue();
+
+
// ----------------------------------------------------------- Constructors
@@ -630,9 +634,10 @@
*/
public void setConnector(Connector connector) {
this.connector = connector;
- SecureRandom seedRandom = connector.getService().getRandom();
- synchronized (seedRandom) {
- random = new SecureRandom(seedRandom.generateSeed(16));
+ if (LOCAL_RANDOM) {
+ random = new
SecureRandom(connector.getService().getRandom().generateSeed(16));
+ } else {
+ random = connector.getService().getRandom();
}
}