db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r785309 - /db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
Date Tue, 16 Jun 2009 17:26:54 GMT
Author: kmarsden
Date: Tue Jun 16 17:26:54 2009
New Revision: 785309

URL: http://svn.apache.org/viewvc?rev=785309&view=rev
Log:
DERBY-3887 Embedded Derby fails under JBoss because of JMX-related conflicts
backed out jmx related changes from DERBY-3745.


Modified:
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java?rev=785309&r1=785308&r2=785309&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
Tue Jun 16 17:26:54 2009
@@ -163,43 +163,7 @@
      * can be enabled on the fly.
      */
     private synchronized void findServer() {
-        //DERBY-3745 We want to avoid the timer leaking class loaders, so we make
-        // sure the context class loader is null before we start the MBean
-        // server which will create threads that we want to have a null context
-        // class loader
         
-        boolean hasGetClassLoaderPerms=false;
-        ClassLoader savecl = null;
-        try {
-            savecl = (ClassLoader)AccessController.doPrivileged(
-               new PrivilegedAction<ClassLoader>() {
-                public ClassLoader run()  {
-                    return Thread.currentThread().getContextClassLoader();
-                }
-            });
-            hasGetClassLoaderPerms = true;
-        } catch (SecurityException se) {
-           // ignore security exception.  Earlier versions of Derby, before the 
-           // DERBY-3745 fix did not require getClassloader permissions.
-           // We may leak class loaders if we are not able to get this, but 
-           // cannot just fail.        
-        }
-        if (hasGetClassLoaderPerms)
-            try {
-                AccessController.doPrivileged(
-                new PrivilegedAction<Object>() {
-                    public Object run()  {
-                        Thread.
-                                                                  currentThread().setContextClassLoader(null);
-                        return null;
-                    }
-                });
-            } catch (SecurityException se1) {
-                // ignore security exception.  Earlier versions of Derby, before the 
-                // DERBY-3745 fix did not require setContextClassloader permissions.
-                // We may leak class loaders if we are not able to set this, but 
-                // cannot just fail.
-            }
         try {
             mbeanServer = AccessController
                     .doPrivileged(new PrivilegedAction<MBeanServer>() {
@@ -216,22 +180,6 @@
             // them registered with JMX if someone else
             // starts the MBean server.
         }
-        if (hasGetClassLoaderPerms)
-            try {
-                final ClassLoader tmpsavecl = savecl;
-                AccessController.doPrivileged(
-                new PrivilegedAction<Object>() {
-                    public Object run()  {
-                        Thread.currentThread().setContextClassLoader(tmpsavecl);
-                        return null;
-                    }
-                });
-            } catch (SecurityException se) {
-                // ignore security exception.  Earlier versions of Derby, before the 
-                // DERBY-3745 fix did not require setContextClassloader permissions.
-                // We may leak class loaders if we are not able to set this, but 
-                // cannot just fail.
-            }
     }
 
     /**



Mime
View raw message