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 9dee448..10c0458 100644 (file)
                 <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>
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 fee7368..c1e836d 100644 (file)
@@ -7,11 +7,14 @@
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
+import javax.management.MXBean;
+
 /**
  * MXBean interface for retrieving write Tx commit statistics.
  *
  * @author Thomas Pantelis
  */
+@MXBean
 public interface CommitStatsMXBean {
     /**
      * Returns the total number of commits that have occurred.
index 2b9306c..1e2a220 100644 (file)
@@ -7,11 +7,14 @@
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
+import javax.management.MXBean;
+
 /**
  * MXBean interface for data store configuration.
  *
  * @author Thomas Pantelis
  */
+@MXBean
 public interface DatastoreConfigurationMXBean {
     long getShardTransactionIdleTimeoutInSeconds();
 
index 8764493..581e909 100644 (file)
@@ -7,11 +7,14 @@
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
 
+import javax.management.MXBean;
+
 /**
  * JMX bean for general datastore info.
  *
  * @author Thomas Pantelis
  */
+@MXBean
 public interface DatastoreInfoMXBean {
 
     double getTransactionCreationRateLimit();
index 15e1cfd..c75ca89 100644 (file)
@@ -8,6 +8,8 @@
 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;
 
 /**
@@ -15,6 +17,9 @@ import org.opendaylight.controller.cluster.mgmt.api.DataTreeListenerInfo;
  *
  * @author Thomas Pantelis
  */
+@MXBean
+@NonNullByDefault
 public interface ShardDataTreeListenerInfoMXBean {
+
     List<DataTreeListenerInfo> getDataTreeChangeListenerInfo();
 }
index 4e5130c..05a0739 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
  */
-
 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;
 
 /**
@@ -16,6 +16,7 @@ import org.opendaylight.controller.cluster.mgmt.api.FollowerInfo;
  *
  * @author syedbahm
  */
+@MXBean
 public interface ShardStatsMXBean {
 
     String getShardName();

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.