Make cds-mgmt-api a JPMS module 10/93310/5
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 23 Oct 2020 16:54:51 +0000 (18:54 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 16 Nov 2020 15:09:49 +0000 (16:09 +0100)
There is little content here, let's formalize it into a module,
so it plays nice with others.

While we are at it, add explicit @MXBean annotations, so that our
intent is documented beyond naming properties.

JIRA: CONTROLLER-1965
Change-Id: I27cc7070559f1156b0cd1d85916356e3297a49f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/cds-mgmt-api/pom.xml
opendaylight/md-sal/cds-mgmt-api/src/main/java/module-info.java [new file with mode: 0644]
opendaylight/md-sal/cds-mgmt-api/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/CommitStatsMXBean.java
opendaylight/md-sal/cds-mgmt-api/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBean.java
opendaylight/md-sal/cds-mgmt-api/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreInfoMXBean.java
opendaylight/md-sal/cds-mgmt-api/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shard/ShardDataTreeListenerInfoMXBean.java
opendaylight/md-sal/cds-mgmt-api/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shard/ShardStatsMXBean.java

index 9dee448583918aab6133e354e2874d56ceef8255..10c045887d877c8c1e6ce3f6b546238f36b348a4 100644 (file)
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
-                        <Automatic-Module-Name>org.opendaylight.controller.cluster.mgmt.api</Automatic-Module-Name>
+                        <Import-Package>
+                            javax.management;resolution:=optional,
+                            *
+                        </Import-Package>
                     </instructions>
                 </configuration>
             </plugin>
                     </instructions>
                 </configuration>
             </plugin>
diff --git a/opendaylight/md-sal/cds-mgmt-api/src/main/java/module-info.java b/opendaylight/md-sal/cds-mgmt-api/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..758f7d1
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.controller.cluster.mgmt.api {
+    exports org.opendaylight.controller.cluster.mgmt.api;
+    // FIXME: 4.0.0: collapse these packages
+    exports org.opendaylight.controller.cluster.datastore.jmx.mbeans;
+    exports org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
+
+    // Annotation-only dependencies
+    requires static java.management;
+    requires static org.eclipse.jdt.annotation;
+}
index fee73688f896ca006db422e4072421477a99c06a..c1e836d937abf502a654b2fc75b7c303f07fa721 100644 (file)
@@ -7,11 +7,14 @@
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
+import javax.management.MXBean;
+
 /**
  * MXBean interface for retrieving write Tx commit statistics.
  *
  * @author Thomas Pantelis
  */
 /**
  * MXBean interface for retrieving write Tx commit statistics.
  *
  * @author Thomas Pantelis
  */
+@MXBean
 public interface CommitStatsMXBean {
     /**
      * Returns the total number of commits that have occurred.
 public interface CommitStatsMXBean {
     /**
      * Returns the total number of commits that have occurred.
index 2b9306cbbe13483957ccdddd6a0b866fc1cad7ba..1e2a2202f1fc2289e5e04c5cd185aac53b5df700 100644 (file)
@@ -7,11 +7,14 @@
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
+import javax.management.MXBean;
+
 /**
  * MXBean interface for data store configuration.
  *
  * @author Thomas Pantelis
  */
 /**
  * MXBean interface for data store configuration.
  *
  * @author Thomas Pantelis
  */
+@MXBean
 public interface DatastoreConfigurationMXBean {
     long getShardTransactionIdleTimeoutInSeconds();
 
 public interface DatastoreConfigurationMXBean {
     long getShardTransactionIdleTimeoutInSeconds();
 
index 8764493c25a5158f22ee8f5c3e55c24f4b819f43..581e90910f452b169e448b80a0055058db70f030 100644 (file)
@@ -7,11 +7,14 @@
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
+import javax.management.MXBean;
+
 /**
  * JMX bean for general datastore info.
  *
  * @author Thomas Pantelis
  */
 /**
  * JMX bean for general datastore info.
  *
  * @author Thomas Pantelis
  */
+@MXBean
 public interface DatastoreInfoMXBean {
 
     double getTransactionCreationRateLimit();
 public interface DatastoreInfoMXBean {
 
     double getTransactionCreationRateLimit();
index 15e1cfd26b4a1b6504d4de7c618111fcbfea5107..c75ca89defe4a2295dc51c5ff3c7fb9570270f29 100644 (file)
@@ -8,6 +8,8 @@
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
 
 import java.util.List;
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
 
 import java.util.List;
+import javax.management.MXBean;
+import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.opendaylight.controller.cluster.mgmt.api.DataTreeListenerInfo;
 
 /**
 import org.opendaylight.controller.cluster.mgmt.api.DataTreeListenerInfo;
 
 /**
@@ -15,6 +17,9 @@ import org.opendaylight.controller.cluster.mgmt.api.DataTreeListenerInfo;
  *
  * @author Thomas Pantelis
  */
  *
  * @author Thomas Pantelis
  */
+@MXBean
+@NonNullByDefault
 public interface ShardDataTreeListenerInfoMXBean {
 public interface ShardDataTreeListenerInfoMXBean {
+
     List<DataTreeListenerInfo> getDataTreeChangeListenerInfo();
 }
     List<DataTreeListenerInfo> getDataTreeChangeListenerInfo();
 }
index 4e5130c0d5816d93b1827eeb4f1d0f5ca927fe3b..05a07396362f0e5cda0dd9aeb0a9e49e1fd02938 100644 (file)
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
 
 import java.util.List;
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
 
 import java.util.List;
+import javax.management.MXBean;
 import org.opendaylight.controller.cluster.mgmt.api.FollowerInfo;
 
 /**
 import org.opendaylight.controller.cluster.mgmt.api.FollowerInfo;
 
 /**
@@ -16,6 +16,7 @@ import org.opendaylight.controller.cluster.mgmt.api.FollowerInfo;
  *
  * @author syedbahm
  */
  *
  * @author syedbahm
  */
+@MXBean
 public interface ShardStatsMXBean {
 
     String getShardName();
 public interface ShardStatsMXBean {
 
     String getShardName();