Author: markt
Date: Thu Mar 31 13:22:11 2011
New Revision: 1087292

URL: http://svn.apache.org/viewvc?rev=1087292&view=rev
Log:
Only register a DataSource with JMX if it is a singleton

Modified:
    tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java
    tomcat/trunk/webapps/docs/changelog.xml
    tomcat/trunk/webapps/docs/config/context.xml

Modified: tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java?rev=1087292&r1=1087291&r2=1087292&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java Thu 
Mar 31 13:22:11 2011
@@ -1014,7 +1014,8 @@ public class NamingContextListener
             logger.error(sm.getString("naming.bindFailed", e));
         }
 
-        if ("javax.sql.DataSource".equals(ref.getClassName())) {
+        if ("javax.sql.DataSource".equals(ref.getClassName()) &&
+                resource.getSingleton()) {
             try {
                 ObjectName on = createObjectName(resource);
                 Object actualResource = envCtx.lookup(resource.getName());

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1087292&r1=1087291&r2=1087292&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Mar 31 13:22:11 2011
@@ -134,6 +134,9 @@
         Don't append the jvmRoute to a session ID if the jvmRoute is a 
zero
         length string. (markt) 
       </fix>
+      <fix>
+        Don&apos;t register non-singelton DataSource resources with JMX. 
(markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">

Modified: tomcat/trunk/webapps/docs/config/context.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/context.xml?rev=1087292&r1=1087291&r2=1087292&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/context.xml (original)
+++ tomcat/trunk/webapps/docs/config/context.xml Thu Mar 31 13:22:11 2011
@@ -1044,8 +1044,11 @@
         attribute is <code>true</code>, multiple JNDI lookups for this resource
         will return the same object. If this attribute is <code>false</code>,
         multiple JNDI lookups for this resource will return different objects.
-        The value of this attribute must be <code>true</code> or
-        <code>false</code>. By default, this attribute is 
<code>true</code>.</p>
+        This attribute must be <code>true</code> for
+        <code>javax.sql.DataSource</code> resources to enable JMX registration
+        of the DataSource. The value of this attribute must be 
<code>true</code>
+        or <code>false</code>. By default, this attribute is <code>true</code>.
+        </p>
       </attribute>
 
       <attribute name="type" required="true">



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

Reply via email to