aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1221320 - in /aries/trunk/sandbox/jmx-next: jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java jmx-itests/src/test/java/org/apache/aries/jmx/framework/wiring/BundleWiringStateMBeanTest.java
Date Tue, 20 Dec 2011 15:43:47 GMT
Author: davidb
Date: Tue Dec 20 15:43:46 2011
New Revision: 1221320

URL: http://svn.apache.org/viewvc?rev=1221320&view=rev
Log:
Improved javadoc and lined up exceptions.


Modified:
    aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java
    aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/wiring/BundleWiringStateMBeanTest.java

Modified: aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java?rev=1221320&r1=1221319&r2=1221320&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java
(original)
+++ aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java
Tue Dec 20 15:43:46 2011
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2010, 2011). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010-2012). All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package org.osgi.jmx.framework.wiring;
 
 import java.io.IOException;
 
+import javax.management.JMException;
 import javax.management.openmbean.ArrayType;
 import javax.management.openmbean.CompositeData;
 import javax.management.openmbean.CompositeType;
@@ -229,103 +230,140 @@ public interface BundleWiringStateMBean 
 
     /**
      * Returns the requirements for the current bundle revision.
-     * The ArrayType is typed by the {@link #REQUIREMENT_TYPE_ARRAY}.
      *
-     * @param bundleId
-     * @param namespace
-     * @return the declared requirements for the current revision of <code>bundleId</code>
-     * and <code>namespace</code>
+     * @see #REQUIREMENT_TYPE_ARRAY for the details of the CompositeData.
      *
+     * @param bundleId The bundle ID.
+     * @param namespace The name space of the requirements to be returned by this operation.
+     * @return the declared requirements for the current revision of <code>bundleId</code>
+     * and <code>namespace</code>.
+     * @throws JMException if there is a JMX problem.
+     * @throws IOException if the connection could not be made because of a communication
problem.
      */
-    CompositeData[] getCurrentRevisionDeclaredRequirements(long bundleId,
-            String namespace) throws IOException;
+    CompositeData[] getCurrentRevisionDeclaredRequirements(long bundleId, String namespace)
+            throws IOException, JMException;
 
     /**
      * Returns the capabilities for the current bundle revision.
-     * The ArrayType is typed by the {@link #CAPABILITY_TYPE_ARRAY}
      *
-     * @param bundleId
-     * @param namespace
+     * @see #CAPABILITY_TYPE_ARRAY for the details of the CompositeData.
+     *
+     * @param bundleId The bundle ID.
+     * @param namespace The name space of the capabilities to be returned by this operation.
      * @return the declared capabilities for the current revision of <code>bundleId</code>
-     * and <code>namespace</code>
+     * and <code>namespace</code>.
+     * @throws JMException if there is a JMX problem.
+     * @throws IOException if the connection could not be made because of a communication
problem.
      */
-    CompositeData[] getCurrentRevisionDeclaredCapabilities(long bundleId,
-            String namespace) throws IOException;
+    CompositeData[] getCurrentRevisionDeclaredCapabilities(long bundleId, String namespace)
+            throws IOException, JMException;
 
     /**
      * Returns the bundle wiring for the current bundle revision.
-     * The ArrayType is typed by the {@link #BUNDLE_WIRING_TYPE}
      *
-     * @param bundleId
-     * @param namespace
-     * @return the wires for the current revision of <code>bundleId</code>
-     * and <code>namespace</code>
+     * @see #BUNDLE_WIRING_TYPE for the details of the CompositeData.
+     *
+     * @param bundleId The bundle ID.
+     * @param namespace The name space of the requirements and capabilities for which to
return information.
+     * @return the wiring information for the current revision of <code>bundleId</code>
+     * and <code>namespace</code>.
+     * @throws JMException if there is a JMX problem.
+     * @throws IOException if the connection could not be made because of a communication
problem.
      */
-    CompositeData getCurrentWiring(long bundleId, String namespace) throws IOException;
+    CompositeData getCurrentWiring(long bundleId, String namespace)
+            throws IOException, JMException;
 
     /**
-     * Returns the bundle wiring closure for the current revision of the specified bundle.
+     * Returns the bundle wiring closure for the current revision of the specified bundle.
The
+     * wiring closure contains all the wirings from the root bundle revision to all bundle
revisions
+     * it is wired to and all their transitive wirings.
      *
-     * @see #BUNDLE_WIRING_CLOSURE_TYPE for the details of the TabularType
+     * @see #BUNDLE_WIRING_CLOSURE_TYPE for the details of the TabularData.
      *
      * @param rootBundleId the root bundle of the closure.
-     * @param namespace the namespace of the capabilities and requirements involved in this
wiring.
-     * @return a tabular representation of all the wiring in the closure. The bundle revision
ids
+     * @param namespace The name space of the requirements and capabilities for which to
return information.
+     * @return a tabular representation of all the wirings in the closure. The bundle revision
IDs
      * only have meaning in the context of the current result. The revision of the rootBundle
is set
-     * to 0.
+     * to 0. Therefore the root bundle of the closure can be looked up in the table by its
bundle ID and
+     * revision 0.
+     * @throws JMException if there is a JMX problem.
+     * @throws IOException if the connection could not be made because of a communication
problem.
      */
-    TabularData getCurrentWiringClosure(long rootBundleId, String namespace) throws IOException;
+    TabularData getCurrentWiringClosure(long rootBundleId, String namespace)
+            throws IOException, JMException;
 
     /**
      * Returns the requirements for all revisions of the bundle.
-     * The ArrayType is typed by the {@link #REVISIONS_REQUIREMENT_TYPE_ARRAY}.
+     *
+     * @see #REVISIONS_REQUIREMENT_TYPE_ARRAY for the details of TabularData.
+     *
      * The requirements are in no particular order, and may change in
      *  subsequent calls to this operation.
      *
-     * @param bundleId
-     * @param namespace
-     * @return the declared requirements for all revisions of <code>bundleId</code>
-     *
+     * @param bundleId The bundle ID.
+     * @param namespace The name space of the requirements to be returned by this operation.
+     * @return the declared requirements for all revisions of <code>bundleId</code>.
+     * @throws JMException if there is a JMX problem.
+     * @throws IOException if the connection could not be made because of a communication
problem.
      */
-    TabularData getRevisionsDeclaredRequirements(long bundleId,
-            String namespace) throws IOException;
+    TabularData getRevisionsDeclaredRequirements(long bundleId, String namespace)
+            throws IOException, JMException;
+
 
     /**
      * Returns the capabilities for all revisions of the bundle.
-     * The ArrayType is typed by the {@link #REVISIONS_CAPABILITY_TYPE_ARRAY}
+     *
+     * @see #REVISIONS_CAPABILITY_TYPE_ARRAY for the details of TabularData.
+     *
      * The capabilities are in no particular order, and may change in
      *  subsequent calls to this operation.
      *
-     * @param bundleId
-     * @param namespace
+     * @param bundleId The bundle ID.
+     * @param namespace The name space of the capabilities to be returned by this operation.
      * @return the declared capabilities for all revisions of <code>bundleId</code>
+     * @throws JMException if there is a JMX problem.
+     * @throws IOException if the connection could not be made because of a communication
problem.
      */
-    TabularData getRevisionsDeclaredCapabilities(long bundleId,
-            String namespace) throws IOException;
+    TabularData getRevisionsDeclaredCapabilities(long bundleId, String namespace)
+            throws IOException, JMException;
 
     /**
      * Returns the bundle wirings for all revisions of the bundle.
-     * The ArrayType is typed by the {@link #BUNDLE_WIRING_TYPE_ARRAY}
+     *
+     * @see #BUNDLE_WIRING_TYPE_ARRAY for the details of TabularData.
+     *
      * The bundle wirings are in no particular order, and may
      *  change in subsequent calls to this operations.
      *
-     * @param bundleId
-     * @param namespace
-     * @return the wires for all revisions of <code>bundleId</code>
+     * @param bundleId The bundle ID.
+     * @param namespace The name space of the requirements and capabilities for which to
return information.
+     * @return the wiring information for all revisions of <code>bundleId</code>
and <code>namespace</code>.
+     * @throws JMException if there is a JMX problem.
+     * @throws IOException if the connection could not be made because of a communication
problem.
      */
-    TabularData getRevisionsWiring(long bundleId, String namespace) throws IOException;
+    TabularData getRevisionsWiring(long bundleId, String namespace)
+            throws IOException, JMException;
 
     /**
-     * Returns a closure of all bundle wirings linked by their
-     *  bundle wires, starting at <code>rootBundleId</code>.
-     * The ArrayType is typed by the {@link #BUNDLE_WIRING_TYPE_ARRAY}
+     * Returns the bundle wiring closure for all revisions of the specified bundle. The
+     * wiring closure contains all the wirings from the root bundle revision to all bundle
revisions
+     * it is wired to and all their transitive wirings.
+     *
+     * @see #BUNDLE_WIRING_TYPE_ARRAY for the details of TabularData.
+     *
      * The bundle wirings are in no particular order, and may
-     *  change in subsequent calls to this operation. Furthermore,
-     * the bundle wiring IDs are local and cannot be reused across invocations.
+     * change in subsequent calls to this operation. Furthermore,
+     * the bundle revision IDs are local and cannot be reused across invocations.
      *
-     * @param rootBundleId
-     * @param namespace
+     * @param rootBundleId The root bundle ID.
+     * @param namespace The name space of the requirements and capabilities for which to
return information.
      * @return a closure of bundle wirings linked together by wires.
+     * @return a tabular representation of all the wirings in the closures. The bundle revision
IDs
+     * only have meaning in the context of the current result.
+     * @throws JMException if there is a JMX problem.
+     * @throws IOException if the connection could not be made because of a communication
problem.
      */
-    TabularData getRevisionsWiringClosure(long rootBundleId, String namespace) throws IOException;
+    TabularData getRevisionsWiringClosure(long rootBundleId, String namespace)
+            throws IOException, JMException;
+
 }
\ No newline at end of file

Modified: aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/wiring/BundleWiringStateMBeanTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/wiring/BundleWiringStateMBeanTest.java?rev=1221320&r1=1221319&r2=1221320&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/wiring/BundleWiringStateMBeanTest.java
(original)
+++ aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/wiring/BundleWiringStateMBeanTest.java
Tue Dec 20 15:43:46 2011
@@ -23,7 +23,6 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -119,7 +118,7 @@ public class BundleWiringStateMBeanTest 
     }
 
     @Test
-    public void testGetCurrentRevisionDeclaredRequirements() throws IOException {
+    public void testGetCurrentRevisionDeclaredRequirements() throws Exception {
         BundleWiringStateMBean brsMBean = getMBean(BundleWiringStateMBean.OBJECTNAME, BundleWiringStateMBean.class);
 
         Bundle a = context().getBundleByName("org.apache.aries.jmx.test.bundlea");
@@ -135,7 +134,7 @@ public class BundleWiringStateMBeanTest 
     }
 
     @Test
-    public void testGetCurrentRevisionDeclaredCapabilities() throws IOException {
+    public void testGetCurrentRevisionDeclaredCapabilities() throws Exception {
         BundleWiringStateMBean brsMBean = getMBean(BundleWiringStateMBean.OBJECTNAME, BundleWiringStateMBean.class);
 
         Bundle a = context().getBundleByName("org.apache.aries.jmx.test.bundlea");
@@ -151,7 +150,7 @@ public class BundleWiringStateMBeanTest 
     }
 
     @Test
-    public void testGetRevisionsDeclaredRequirements() throws IOException {
+    public void testGetRevisionsDeclaredRequirements() throws Exception {
         BundleWiringStateMBean brsMBean = getMBean(BundleWiringStateMBean.OBJECTNAME, BundleWiringStateMBean.class);
 
         Bundle a = context().getBundleByName("org.apache.aries.jmx.test.bundlea");
@@ -172,7 +171,7 @@ public class BundleWiringStateMBeanTest 
     }
 
     @Test
-    public void testGetRevisionsDeclaredCapabilities() throws IOException {
+    public void testGetRevisionsDeclaredCapabilities() throws Exception {
         BundleWiringStateMBean brsMBean = getMBean(BundleWiringStateMBean.OBJECTNAME, BundleWiringStateMBean.class);
 
         Bundle a = context().getBundleByName("org.apache.aries.jmx.test.bundlea");
@@ -193,7 +192,7 @@ public class BundleWiringStateMBeanTest 
     }
 
     @Test
-    public void testGetCurrentWiring() throws IOException {
+    public void testGetCurrentWiring() throws Exception {
         BundleWiringStateMBean brsMBean = getMBean(BundleWiringStateMBean.OBJECTNAME, BundleWiringStateMBean.class);
 
         Bundle a = context().getBundleByName("org.apache.aries.jmx.test.bundlea");
@@ -207,7 +206,7 @@ public class BundleWiringStateMBeanTest 
     }
 
     @Test
-    public void testRevisionsWiring() throws IOException {
+    public void testRevisionsWiring() throws Exception {
         BundleWiringStateMBean brsMBean = getMBean(BundleWiringStateMBean.OBJECTNAME, BundleWiringStateMBean.class);
 
         Bundle a = context().getBundleByName("org.apache.aries.jmx.test.bundlea");



Mime
View raw message