[jboss-cvs] JBossAS SVN: r93473 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 14 09:36:52 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-09-14 09:36:52 -0400 (Mon, 14 Sep 2009)
New Revision: 93473

Modified:
   projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
Log:
Fix dependency on compendium symbolic name

Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java	2009-09-14 12:59:02 UTC (rev 93472)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java	2009-09-14 13:36:52 UTC (rev 93473)
@@ -98,9 +98,21 @@
    {
       try
       {
+         RemoteBundle bundle = null;
+         
          // Asume that the compendium is already installed in the remote runtime
-         ManagedBundleMBean bundleMBean = getRemoteFramework().getBundle("osgi.cmpn", null);
-         RemoteBundle bundle = new RemoteBundle(this, bundleMBean, null);
+         for (ManagedBundleMBean bundleMBean : getRemoteFramework().getBundles())
+         {
+            String symbolicName = bundleMBean.getSymbolicName();
+            if (symbolicName.equals("org.osgi.compendium") || symbolicName.equals("osgi.cmpn"))
+            {
+               bundle = new RemoteBundle(this, bundleMBean, null);
+            }
+         }
+         
+         if (bundle == null)
+            throw new BundleException("Cannot obtain compendium");
+         
          return bundle;
       }
       catch (RuntimeException rte)
@@ -109,7 +121,7 @@
       }
       catch (Exception ex)
       {
-         throw new BundleException("Cannot install compendium", ex);
+         throw new BundleException("Cannot obtain compendium", ex);
       }
    }
 




More information about the jboss-cvs-commits mailing list