karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r961794 - /karaf/trunk/features/management/src/main/java/org/apache/karaf/features/management/codec/JmxFeature.java
Date Thu, 08 Jul 2010 15:17:13 GMT
Author: gnodet
Date: Thu Jul  8 15:17:12 2010
New Revision: 961794

URL: http://svn.apache.org/viewvc?rev=961794&view=rev
Log:
Fix exception in jmx layer when browsing features

Modified:
    karaf/trunk/features/management/src/main/java/org/apache/karaf/features/management/codec/JmxFeature.java

Modified: karaf/trunk/features/management/src/main/java/org/apache/karaf/features/management/codec/JmxFeature.java
URL: http://svn.apache.org/viewvc/karaf/trunk/features/management/src/main/java/org/apache/karaf/features/management/codec/JmxFeature.java?rev=961794&r1=961793&r2=961794&view=diff
==============================================================================
--- karaf/trunk/features/management/src/main/java/org/apache/karaf/features/management/codec/JmxFeature.java
(original)
+++ karaf/trunk/features/management/src/main/java/org/apache/karaf/features/management/codec/JmxFeature.java
Thu Jul  8 15:17:12 2010
@@ -31,6 +31,7 @@ import javax.management.openmbean.Compos
 import javax.management.openmbean.CompositeDataSupport;
 import javax.management.openmbean.TabularDataSupport;
 
+import org.apache.karaf.features.BundleInfo;
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.management.FeaturesServiceMBean;
 
@@ -68,8 +69,8 @@ public class JmxFeature {
             itemValues[0] = feature.getName();
             itemValues[1] = feature.getVersion();
             itemValues[2] = getFeatureIdentifierTable(feature.getDependencies());
-            itemValues[3] = feature.getBundles().toArray(new String[feature.getBundles().size()]);
-            itemValues[4]  = getConfigTable(feature.getConfigurations());
+            itemValues[3] = getBundleUris(feature.getBundles());
+            itemValues[4] = getConfigTable(feature.getConfigurations());
             itemValues[5] = installed;
             data = new CompositeDataSupport(FEATURE, itemNames, itemValues);
         } catch (OpenDataException e) {
@@ -100,6 +101,14 @@ public class JmxFeature {
         return table;
     }
 
+    static String[] getBundleUris(List<BundleInfo> infos) {
+        String[] array = new String[infos.size()];
+        for (int i = 0; i < array.length; i++) {
+            array[i] = infos.get(i).getLocation();
+        }
+        return array;
+    }
+
     static TabularData getConfigTable(Map<String, Map<String, String>> configs)
throws OpenDataException {
         TabularDataSupport table = new TabularDataSupport(FEATURE_CONFIG_TABLE);
         for (Map.Entry<String, Map<String, String>> entry : configs.entrySet())
{



Mime
View raw message