geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1458113 - in /geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting: JMXConnector.java JMXSecureConnector.java
Date Tue, 19 Mar 2013 03:43:28 GMT
Author: gawor
Date: Tue Mar 19 03:43:27 2013
New Revision: 1458113

URL: http://svn.apache.org/r1458113
Log:
set better classloader for jmx

Modified:
    geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXConnector.java
    geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXSecureConnector.java

Modified: geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXConnector.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXConnector.java?rev=1458113&r1=1458112&r2=1458113&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXConnector.java
(original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXConnector.java
Tue Mar 19 03:43:27 2013
@@ -192,21 +192,23 @@ public class JMXConnector implements JMX
         if (applicationConfigName != null) {
             authenticator = new Authenticator(applicationConfigName, classLoader);
             String accessconfig = serverInfo.resolveServerPath("var/security/jmx_access.properties");
-	    env.put("jmx.remote.x.access.file",accessconfig);
+            env.put("jmx.remote.x.access.file", accessconfig);
             env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
         } else {
             log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
         }
         RMIServerSocketFactory serverSocketFactory = new GeronimoRMIServerSocketFactory(host);
         env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, serverSocketFactory);
+        
         server = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, env, mbeanServer);
         NotificationFilterSupport filter = new NotificationFilterSupport();
         filter.enableType(JMXConnectionNotification.OPENED);
         filter.enableType(JMXConnectionNotification.CLOSED);
         filter.enableType(JMXConnectionNotification.FAILED);
         server.addNotificationListener(authenticator, filter, null);
+        
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
-        Thread.currentThread().setContextClassLoader(classLoader);
+        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
         try {
             server.start();
         } finally {

Modified: geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXSecureConnector.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXSecureConnector.java?rev=1458113&r1=1458112&r2=1458113&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXSecureConnector.java
(original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXSecureConnector.java
Tue Mar 19 03:43:27 2013
@@ -139,7 +139,7 @@ public class JMXSecureConnector extends 
         if (applicationConfigName != null) {
             authenticator = new Authenticator(applicationConfigName, classLoader);
             String accessconfig = serverInfo.resolveServerPath("var/security/jmx_access.properties");
-	    env.put("jmx.remote.x.access.file",accessconfig);
+            env.put("jmx.remote.x.access.file", accessconfig);
             env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
         } else {
             log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
@@ -157,7 +157,14 @@ public class JMXSecureConnector extends 
         filter.enableType(JMXConnectionNotification.CLOSED);
         filter.enableType(JMXConnectionNotification.FAILED);
         server.addNotificationListener(authenticator, filter, null);
-        server.start();
+        
+        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
+        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+        try {
+            server.start();
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldCl);
+        }
         log.debug("Started JMXConnector " + server.getAddress());
     }
 



Mime
View raw message