You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2012/09/17 18:34:39 UTC

svn commit: r1386705 - in /karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages: PackagesMBean.java internal/PackagesMBeanImpl.java

Author: jbonofre
Date: Mon Sep 17 16:34:39 2012
New Revision: 1386705

URL: http://svn.apache.org/viewvc?rev=1386705&view=rev
Log:
[KARAF-1831] For migration purpose, PackagesMBean now support exports and imports attributes

Modified:
    karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/PackagesMBean.java
    karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/internal/PackagesMBeanImpl.java

Modified: karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/PackagesMBean.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/PackagesMBean.java?rev=1386705&r1=1386704&r2=1386705&view=diff
==============================================================================
--- karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/PackagesMBean.java (original)
+++ karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/PackagesMBean.java Mon Sep 17 16:34:39 2012
@@ -16,18 +16,64 @@
  */
 package org.apache.karaf.management.mbeans.packages;
 
-import javax.management.openmbean.TabularData;
 import java.util.List;
 
-/**
- * Packages MBean
- */
 public interface PackagesMBean {
 
+    /**
+     * Get the exported packages.
+     *
+     * @return the list of exported packages.
+     * @throws Exception
+     */
+    List<String> getExports() throws Exception;
+
+    /**
+     * Get the exported packages of a given bundle.
+     *
+     * @param bundleId the bundle ID.
+     * @return the exported packages of the bundle.
+     * @throws Exception
+     */
+    List<String> getExports(long bundleId) throws Exception;
+
+    /**
+     * Get the imported packages.
+     *
+     * @return the list of imported packages.
+     * @throws Exception
+     */
+    List<String> getImports() throws Exception;
+
+    /**
+     * Get the imported packages of a given bundle.
+     *
+     * @param bundleId the bundle ID.
+     * @return the list of imported packages of the bundle.
+     * @throws Exception
+     */
+    List<String> getImports(long bundleId) throws Exception;
+
+    /* for backward compatibility */
+
+    /**
+     * @deprecated use getExports() instead
+     */
     List<String> exportedPackages() throws Exception;
+
+    /**
+     * @deprecated use getExports() instead
+     */
     List<String> exportedPackages(long bundleId) throws Exception;
 
+    /**
+     * @deprecated use getImports(bundleId) instead
+     */
     List<String> importedPackages() throws Exception;
+
+    /**
+     * @deprecated use getImports(bundleId) instead
+     */
     List<String> importedPackages(long bundleId) throws Exception;
 
 }

Modified: karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/internal/PackagesMBeanImpl.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/internal/PackagesMBeanImpl.java?rev=1386705&r1=1386704&r2=1386705&view=diff
==============================================================================
--- karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/internal/PackagesMBeanImpl.java (original)
+++ karaf/branches/karaf-2.3.x/management/mbeans/packages/src/main/java/org/apache/karaf/management/mbeans/packages/internal/PackagesMBeanImpl.java Mon Sep 17 16:34:39 2012
@@ -39,11 +39,11 @@ public class PackagesMBeanImpl extends S
         super(PackagesMBean.class);
     }
 
-    public List<String> exportedPackages() throws Exception {
-        return exportedPackages(-1);
+    public List<String> getExports() throws Exception {
+        return getExports(-1);
     }
 
-    public List<String> exportedPackages(long bundleId) throws Exception {
+    public List<String> getExports(long bundleId) throws Exception {
         List<String> exportPackages = new ArrayList<String>();
         ServiceReference ref = bundleContext.getServiceReference(PackageAdmin.class.getName());
         if (ref == null) {
@@ -73,11 +73,11 @@ public class PackagesMBeanImpl extends S
         return exportPackages;
     }
 
-    public List<String> importedPackages() throws Exception {
-        return importedPackages(-1);
+    public List<String> getImports() throws Exception {
+        return getImports(-1);
     }
 
-    public List<String> importedPackages(long bundleId) throws Exception {
+    public List<String> getImports(long bundleId) throws Exception {
         List<String> importPackages = new ArrayList<String>();
         ServiceReference ref = bundleContext.getServiceReference(PackageAdmin.class.getName());
         if (ref == null) {
@@ -106,6 +106,34 @@ public class PackagesMBeanImpl extends S
         return importPackages;
     }
 
+    /**
+     * @deprecated use getExports() instead.
+     */
+    public List<String> exportedPackages() throws Exception {
+        return getExports();
+    }
+
+    /**
+     * @deprecated use getExports()
+     */
+    public List<String> exportedPackages(long bundleId) throws Exception {
+        return getExports(bundleId);
+    }
+
+    /**
+     * @deprecated use getImports() instead.
+     */
+    public List<String> importedPackages() throws Exception {
+        return getImports();
+    }
+
+    /**
+     * @deprecated use getImports() instead.
+     */
+    public List<String> importedPackages(long bundleId) throws Exception {
+        return getImports(bundleId);
+    }
+
     public BundleContext getBundleContext() {
         return this.bundleContext;
     }