[jboss-cvs] JBossAS SVN: r103622 - in projects/jboss-osgi/projects: bundles/jmx/trunk/impl/src/main/java/org/jboss/osgi/jmx/internal and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 7 05:44:11 EDT 2010


Author: thomas.diesler at jboss.com
Date: 2010-04-07 05:44:09 -0400 (Wed, 07 Apr 2010)
New Revision: 103622

Added:
   projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java
Removed:
   projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java
Modified:
   projects/jboss-osgi/projects/bundles/jmx/trunk/api/src/main/java/org/jboss/osgi/jmx/JMXConstantsExt.java
   projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/main/java/org/jboss/osgi/jmx/internal/JMXServiceActivator.java
   projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java
   projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/resources/jboss-osgi-framework.properties
   projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
   projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
Log:
Use REMOTE_JMX_RMI_ADAPTOR_NAME = "osgi/jmx/RMIAdaptor"

Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/api/src/main/java/org/jboss/osgi/jmx/JMXConstantsExt.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/api/src/main/java/org/jboss/osgi/jmx/JMXConstantsExt.java	2010-04-07 09:39:57 UTC (rev 103621)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/api/src/main/java/org/jboss/osgi/jmx/JMXConstantsExt.java	2010-04-07 09:44:09 UTC (rev 103622)
@@ -37,4 +37,6 @@
    String REMOTE_JMX_RMI_PORT = "org.jboss.osgi.jmx.rmi.port";
    /** The property that sets the JNDI name the RMIAdaptor binds to: org.jboss.osgi.jmx.rmi.adaptor */
    String REMOTE_JMX_RMI_ADAPTOR = "org.jboss.osgi.jmx.rmi.adaptor";
+   /** The default JNDI name the RMIAdaptor binds to: osgi/jmx/RMIAdaptor */
+   String REMOTE_JMX_RMI_ADAPTOR_NAME = "osgi/jmx/RMIAdaptor";
 }
\ No newline at end of file

Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/main/java/org/jboss/osgi/jmx/internal/JMXServiceActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/main/java/org/jboss/osgi/jmx/internal/JMXServiceActivator.java	2010-04-07 09:39:57 UTC (rev 103621)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/main/java/org/jboss/osgi/jmx/internal/JMXServiceActivator.java	2010-04-07 09:44:09 UTC (rev 103622)
@@ -26,8 +26,13 @@
 import java.io.IOException;
 
 import javax.management.MBeanServer;
+import javax.management.MBeanServerConnection;
 import javax.management.remote.JMXServiceURL;
+import javax.naming.Context;
 import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.StringRefAddr;
 
 import org.jboss.logging.Logger;
 import org.jboss.osgi.jmx.JMXConstantsExt;
@@ -46,10 +51,11 @@
 {
    // Provide logging
    private static final Logger log = Logger.getLogger(JMXServiceActivator.class);
-   
+
    private JMXConnectorService jmxConnector;
    private String jmxHost;
    private String jmxRmiPort;
+   private String rmiAdaptorName;
    private MBeanServer mbeanServer;
    private FrameworkStateExt frameworkState;
    private ServiceStateExt serviceState;
@@ -72,15 +78,15 @@
       // Register the ServiceStateMBean 
       serviceState = new ServiceStateExt(sysContext, mbeanServer);
       serviceState.start();
-      
+
       // Register the BundleStateMBean 
       bundleState = new BundleStateExt(sysContext, mbeanServer);
       bundleState.start();
-      
+
       // Register the PackageStateMBean 
       packageState = new PackageStateExt(sysContext, mbeanServer);
       packageState.start();
-      
+
       jmxHost = context.getProperty(JMXConstantsExt.REMOTE_JMX_HOST);
       if (jmxHost == null)
          jmxHost = "localhost";
@@ -89,8 +95,12 @@
       if (jmxRmiPort == null)
          jmxRmiPort = "1098";
 
+      rmiAdaptorName = context.getProperty(JMXConstantsExt.REMOTE_JMX_RMI_ADAPTOR);
+      if (rmiAdaptorName == null)
+         rmiAdaptorName = JMXConstantsExt.REMOTE_JMX_RMI_ADAPTOR_NAME;
+
       // Start tracking the NamingService
-      InitialContextTracker tracker = new InitialContextTracker(context);
+      InitialContextTracker tracker = new InitialContextTracker(context, rmiAdaptorName);
       tracker.open();
    }
 
@@ -104,10 +114,10 @@
 
       // Unregister the BundleStateMBean 
       bundleState.stop();
-      
+
       // Unregister the PackageStateMBean 
       packageState.stop();
-      
+
       if (jmxConnector != null)
       {
          jmxConnector.stop();
@@ -117,9 +127,13 @@
 
    class InitialContextTracker extends ServiceTracker
    {
-      public InitialContextTracker(BundleContext context)
+      private String rmiAdaptorName;
+      private boolean rmiAdaptorBound;
+
+      public InitialContextTracker(BundleContext context, String rmiAdaptorName)
       {
          super(context, InitialContext.class.getName(), null);
+         this.rmiAdaptorName = rmiAdaptorName;
       }
 
       @Override
@@ -140,18 +154,65 @@
             // Assume that the JMXConnector is already running if we cannot start it 
             log.debug("Assume JMXConnectorServer already running on: " + serviceURL);
          }
+
+         try
+         {
+            // Check if the RMIAdaptor is already bound
+            iniCtx.lookup(rmiAdaptorName);
+         }
+         catch (NamingException lookupEx)
+         {
+            // Bind the RMIAdaptor
+            try
+            {
+               String[] tokens = rmiAdaptorName.split("/");
+               Context ctx = iniCtx;
+               for (int i = 0; i < tokens.length - 1; i++)
+               {
+                  String token = tokens[i];
+                  ctx = ctx.createSubcontext(token);
+               }
+               StringRefAddr addr = new StringRefAddr(JMXServiceURL.class.getName(), serviceURL.toString());
+               Reference ref = new Reference(MBeanServerConnection.class.getName(), addr, RMIAdaptorFactory.class.getName(), null);
+               iniCtx.bind(rmiAdaptorName, ref);
+               rmiAdaptorBound = true;
+
+               log.info("MBeanServerConnection bound to: " + rmiAdaptorName);
+            }
+            catch (NamingException ex)
+            {
+               log.error("Cannot bind RMIAdaptor", ex);
+            }
+         }
          return iniCtx;
       }
 
       @Override
       public void removedService(ServiceReference reference, Object service)
       {
+         InitialContext iniCtx = (InitialContext)service;
+
          // Stop JMXConnectorService
          if (jmxConnector != null)
          {
             jmxConnector.stop();
             jmxConnector = null;
          }
+
+         // Unbind the RMIAdaptor
+         if (rmiAdaptorBound == true)
+         {
+            try
+            {
+               iniCtx.unbind(rmiAdaptorName);
+               log.info("MBeanServerConnection unbound from: " + rmiAdaptorName);
+            }
+            catch (NamingException ex)
+            {
+               log.error("Cannot unbind RMIAdaptor", ex);
+            }
+         }
+
          super.removedService(reference, service);
       }
    }

Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java	2010-04-07 09:39:57 UTC (rev 103621)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java	2010-04-07 09:44:09 UTC (rev 103622)
@@ -60,7 +60,7 @@
    private MBeanServer server;
    
    @BeforeClass
-   public static void setUpClass() throws Exception
+   public static void beforeAbstractJMXTestCase() throws Exception
    {
       // Install/Start the jboss-osgi-jmx bundle
       String bundleName = System.getProperty("project.build.finalName");

Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java	2010-04-07 09:39:57 UTC (rev 103621)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java	2010-04-07 09:44:09 UTC (rev 103622)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.jmx;
-
-//$Id: ServiceStateTestCase.java 103562 2010-04-06 10:25:15Z thomas.diesler at jboss.com $
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URL;
-import java.util.Map;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-
-import org.jboss.osgi.jmx.ObjectNameFactory;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.jmx.framework.BundleStateMBean;
-import org.osgi.jmx.framework.FrameworkMBean;
-import org.osgi.jmx.framework.ServiceStateMBean;
-
-/**
- * Test JSR160 remote connectivity.
- * 
- * @author thomas.diesler at jboss.com
- * @since 06-Apr-2010
- */
-public class JSR160TestCase extends AbstractJMXTestCase
-{
-   @Test
-   public void testJMXConnector() throws Exception
-   {
-      URL url = getTestArchiveURL("bundles/jboss-osgi-common-core.jar");
-      Bundle bundle = systemContext.installBundle(url.toExternalForm());
-      bundle.start();
-      
-      url = getTestArchiveURL("bundles/jboss-osgi-jndi.jar");
-      bundle = systemContext.installBundle(url.toExternalForm());
-      bundle.start();
-      
-      // The address of the connector server
-      JMXServiceURL address = new JMXServiceURL("service:jmx:rmi://localhost/jndi/rmi://localhost:1098/jmxconnector");
-
-      // The environment map, null in this case
-      Map<String, ?> environment = null;
-
-      // Create the JMXCconnectorServer
-      JMXConnector cntor = JMXConnectorFactory.connect(address, environment);
-
-      // Obtain a "stub" for the remote MBeanServer
-      MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
-
-      // Call the remote MBeanServer
-      String domain = mbsc.getDefaultDomain();
-      assertEquals("DefaultDomain", domain);
-      
-      ObjectName fwkName = ObjectNameFactory.create(FrameworkMBean.OBJECTNAME);
-      ObjectName bndName = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
-      ObjectName srvName = ObjectNameFactory.create(ServiceStateMBean.OBJECTNAME);
-
-      assertTrue(isMBeanRegistered(mbsc, fwkName, true));
-      assertTrue(isMBeanRegistered(mbsc, bndName, true));
-      assertTrue(isMBeanRegistered(mbsc, srvName, true));
-   }
-}
\ No newline at end of file

Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java (from rev 103579, projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java	                        (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/java/org/jboss/test/osgi/jmx/JSR160TestCase.java	2010-04-07 09:44:09 UTC (rev 103622)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jmx;
+
+//$Id: ServiceStateTestCase.java 103562 2010-04-06 10:25:15Z thomas.diesler at jboss.com $
+
+import static org.jboss.osgi.jmx.JMXConstantsExt.REMOTE_JMX_RMI_ADAPTOR_NAME;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Map;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.naming.InitialContext;
+
+import org.jboss.osgi.jmx.ObjectNameFactory;
+import org.junit.Test;
+import org.osgi.jmx.framework.BundleStateMBean;
+import org.osgi.jmx.framework.FrameworkMBean;
+import org.osgi.jmx.framework.ServiceStateMBean;
+
+/**
+ * Test JSR160 remote connectivity.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 06-Apr-2010
+ */
+public class JSR160TestCase extends AbstractJMXTestCase
+{
+   @Test
+   public void testJMXConnector() throws Exception
+   {
+      // The address of the connector server
+      JMXServiceURL address = new JMXServiceURL("service:jmx:rmi://localhost/jndi/rmi://localhost:1098/jmxconnector");
+
+      // The environment map, null in this case
+      Map<String, ?> environment = null;
+
+      // Create the JMXCconnectorServer
+      JMXConnector cntor = JMXConnectorFactory.connect(address, environment);
+
+      // Obtain a "stub" for the remote MBeanServer
+      MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+
+      // Call the remote MBeanServer
+      String domain = mbsc.getDefaultDomain();
+      assertEquals("DefaultDomain", domain);
+      
+      ObjectName fwkName = ObjectNameFactory.create(FrameworkMBean.OBJECTNAME);
+      ObjectName bndName = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
+      ObjectName srvName = ObjectNameFactory.create(ServiceStateMBean.OBJECTNAME);
+
+      assertTrue(isMBeanRegistered(mbsc, fwkName, true));
+      assertTrue(isMBeanRegistered(mbsc, bndName, true));
+      assertTrue(isMBeanRegistered(mbsc, srvName, true));
+   }
+
+   @Test
+   public void testRMIAdaptor() throws Exception
+   {
+      InitialContext iniCtx = getInitialContext();
+      MBeanServerConnection mbsc = (MBeanServerConnection)iniCtx.lookup(REMOTE_JMX_RMI_ADAPTOR_NAME);
+
+      // Call the remote MBeanServer
+      String domain = mbsc.getDefaultDomain();
+      assertEquals("DefaultDomain", domain);
+      
+      ObjectName fwkName = ObjectNameFactory.create(FrameworkMBean.OBJECTNAME);
+      ObjectName bndName = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
+      ObjectName srvName = ObjectNameFactory.create(ServiceStateMBean.OBJECTNAME);
+
+      assertTrue(isMBeanRegistered(mbsc, fwkName, true));
+      assertTrue(isMBeanRegistered(mbsc, bndName, true));
+      assertTrue(isMBeanRegistered(mbsc, srvName, true));
+   }
+}
\ No newline at end of file

Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/resources/jboss-osgi-framework.properties	2010-04-07 09:39:57 UTC (rev 103621)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/impl/src/test/resources/jboss-osgi-framework.properties	2010-04-07 09:44:09 UTC (rev 103622)
@@ -32,4 +32,7 @@
 org.jboss.osgi.spi.framework.autoStart=\
 	file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
 	file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
-	file://${test.archive.directory}/bundles/org.apache.aries.jmx.jar
\ No newline at end of file
+	file://${test.archive.directory}/bundles/org.apache.aries.jmx.jar \
+	file://${test.archive.directory}/bundles/jboss-osgi-common-core.jar \
+	file://${test.archive.directory}/bundles/jboss-osgi-jndi.jar
+	
\ No newline at end of file

Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java	2010-04-07 09:39:57 UTC (rev 103621)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java	2010-04-07 09:44:09 UTC (rev 103622)
@@ -134,7 +134,7 @@
       {
          Throwable cause = rte.getCause() != null ? rte.getCause() : rte;
          if (cause instanceof InstanceNotFoundException == false)
-            log.warn("Cannot get state for bundle: " + bundleId, cause);
+            log.warn("Cannot get state for bundle: " + this, cause);
 
          return Bundle.UNINSTALLED;
       }
@@ -281,7 +281,7 @@
       }
       catch (IOException ex)
       {
-         throw new BundleException("Cannot start bundle: " + bundleId, ex);
+         throw new BundleException("Cannot start bundle: " + this, ex);
       }
    }
 
@@ -295,7 +295,7 @@
       }
       catch (IOException ex)
       {
-         throw new BundleException("Cannot stop bundle: " + bundleId, ex);
+         throw new BundleException("Cannot stop bundle: " + this, ex);
       }
    }
 

Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java	2010-04-07 09:39:57 UTC (rev 103621)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java	2010-04-07 09:44:09 UTC (rev 103622)
@@ -67,6 +67,9 @@
 {
    // Provide logging
    private static final Logger log = Logger.getLogger(RemoteRuntime.class);
+   
+   private MBeanServerConnection mbeanServer;
+   private JMXConnector jmxConnector;
 
    public RemoteRuntime(OSGiRuntimeHelper helper)
    {
@@ -74,6 +77,12 @@
    }
 
    @Override
+   public boolean isRemoteRuntime()
+   {
+      return true;
+   }
+   
+   @Override
    OSGiBundle installBundleInternal(BundleInfo info) throws BundleException
    {
       try
@@ -212,7 +221,46 @@
    @Override
    public MBeanServerConnection getMBeanServer()
    {
-      MBeanServerConnection mbeanServer = null;
+      // Get the MBeanServerConnection through the RMIAdaptor
+      if (mbeanServer == null)
+      {
+         try
+         {
+            InitialContext iniCtx = getInitialContext();
+            mbeanServer = (MBeanServerConnection)iniCtx.lookup("osgi/jmx/RMIAdaptor");
+         }
+         catch (NamingException ex)
+         {
+            log.debug("Cannot obtain MBeanServerConnection through the RMIAdaptor", ex);
+         }
+      }
+      
+      // Fall back to the JMXConnector
+      if (mbeanServer == null)
+      {
+         jmxConnector = getJMXConnector();
+         if (jmxConnector != null)
+         {
+            try
+            {
+               mbeanServer = jmxConnector.getMBeanServerConnection();
+            }
+            catch (IOException ex)
+            {
+               log.debug("Cannot obtain MBeanServerConnection through JMXConnector", ex);
+            }
+         }
+      }
+      
+      if (mbeanServer == null)
+         throw new IllegalStateException("Cannot obtain MBeanServerConnection");
+      
+      return mbeanServer;
+   }
+
+   private JMXConnector getJMXConnector()
+   {
+      JMXConnector connector = null;
       try
       {
          String host = getServerHost();
@@ -225,36 +273,31 @@
          Map<String, ?> env = null;
 
          // Create the JMXCconnectorServer
-         JMXConnector cntor = JMXConnectorFactory.connect(address, env);
-
-         // Obtain a "stub" for the remote MBeanServer
-         mbeanServer = cntor.getMBeanServerConnection();
+         connector = JMXConnectorFactory.connect(address, env);
       }
       catch (Exception ex)
       {
-         log.warn("Cannot obtain MBeanServerConnection", ex);
+         log.debug("Cannot obtain JMXConnector", ex);
       }
+      return connector;
+   }
 
-      // Fall back to the legacy JNDI name
-      if (mbeanServer == null)
+   @Override
+   public void shutdown()
+   {
+      super.shutdown();
+      
+      // Close the JMXConnector
+      if (jmxConnector != null)
       {
          try
          {
-            InitialContext iniCtx = getInitialContext();
-            mbeanServer = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+            jmxConnector.close();
          }
-         catch (NamingException ex)
+         catch (IOException ex)
          {
-            log.warn("Cannot obtain MBeanServerConnection", ex);
+            log.warn("Cannot close JMXConnector", ex);
          }
       }
-      
-      return mbeanServer;
    }
-
-   @Override
-   public boolean isRemoteRuntime()
-   {
-      return true;
-   }
 }




More information about the jboss-cvs-commits mailing list