qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r727343 - /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
Date Wed, 17 Dec 2008 11:17:33 GMT
Author: ritchiem
Date: Wed Dec 17 03:17:32 2008
New Revision: 727343

URL: http://svn.apache.org/viewvc?rev=727343&view=rev
Log:
QPID-1538 : Reverted r727068

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java?rev=727343&r1=727342&r2=727343&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
Wed Dec 17 03:17:32 2008
@@ -59,7 +59,7 @@
     private final MBeanServer _mbeanServer;
     private Registry _rmiRegistry;
     private JMXServiceURL _jmxURL;
-
+    
     public static final String MANAGEMENT_PORT_CONFIG_PATH = "management.jmxport";
     public static final int MANAGEMENT_PORT_DEFAULT = 8999;
 
@@ -73,9 +73,10 @@
 
         _mbeanServer =
                 platformServer ? ManagementFactory.getPlatformMBeanServer()
-                               : MBeanServerFactory.createMBeanServer(ManagedObject.DOMAIN);
+                : MBeanServerFactory.createMBeanServer(ManagedObject.DOMAIN);
     }
 
+
     public void start() throws IOException
     {
         // Check if the "QPID_OPTS" is set to use Out of the Box JMXAgent
@@ -90,13 +91,12 @@
         boolean security = appRegistry.getConfiguration().getBoolean("management.security-enabled",
false);
         int port = appRegistry.getConfiguration().getInt(MANAGEMENT_PORT_CONFIG_PATH, MANAGEMENT_PORT_DEFAULT);
 
-        Map env = new HashMap();
-
         if (security)
         {
             // For SASL using JMXMP
             _jmxURL = new JMXServiceURL("jmxmp", null, port);
 
+            Map env = new HashMap();
             Map<String, PrincipalDatabase> map = appRegistry.getDatabaseManager().getDatabases();
             PrincipalDatabase db = null;
 
@@ -139,20 +139,18 @@
            env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, ssf);
             */
 
-            _log.warn("JMX: Starting JMXConnector server  on port '" + port + "' with SASL");
+            JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(_jmxURL,
env, _mbeanServer);
+            MBeanServerForwarder mbsf = MBeanInvocationHandlerImpl.newProxyInstance();
+            cs.setMBeanServerForwarder(mbsf);
+            cs.start();
+            _log.warn("JMX: Started JMXConnector server  on port '" + port + "' with SASL");
 
         }
         else
         {
-            env = null;
-            _jmxURL = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + port
+ "/jmxrmi");
-            _log.warn("JMX: Starting JMXConnector server on port '" + port + "' with security
disabled");
+            startJMXConnectorServer(port);
+            _log.warn("JMX: Started JMXConnector server on port '" + port + "' with security
disabled");
         }
-
-        
-        startJMXConnectorServer(port, env);
-        _log.warn("JMX: Started JMXConnector server on port '" + port + "'");
-
     }
 
     /**
@@ -160,18 +158,13 @@
      *
      * @param port
      *
-     * @param env
      * @throws IOException
      */
-    private void startJMXConnectorServer(int port, Map env) throws IOException
+    private void startJMXConnectorServer(int port) throws IOException
     {
         startRMIRegistry(port);
-
-        JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(_jmxURL,
env, _mbeanServer);
-
-        MBeanServerForwarder mbsf = MBeanInvocationHandlerImpl.newProxyInstance();
-        cs.setMBeanServerForwarder(mbsf);
-
+        _jmxURL = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + port + "/jmxrmi");
+        JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(_jmxURL,
null, _mbeanServer);
         cs.start();
     }
 



Mime
View raw message