From 1419172fbd04c7fcfe6a10cebc570b9035ff4fd1 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 18 Mar 2022 15:25:35 +0100 Subject: [PATCH] Polish Javadoc for JMX support --- .../annotation/AnnotationJmxAttributeSource.java | 4 ++-- .../export/annotation/AnnotationMBeanExporter.java | 4 ++-- .../jmx/export/annotation/ManagedMetric.java | 3 ++- .../jmx/export/annotation/ManagedNotification.java | 6 ++++-- .../jmx/export/annotation/ManagedNotifications.java | 10 +++++++--- .../jmx/export/annotation/ManagedOperation.java | 10 ++++++---- .../export/annotation/ManagedOperationParameter.java | 12 ++++++------ .../annotation/ManagedOperationParameters.java | 10 +++++++--- .../jmx/export/annotation/ManagedResource.java | 6 +++--- .../jmx/export/annotation/package-info.java | 7 ++++--- 10 files changed, 43 insertions(+), 29 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationJmxAttributeSource.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationJmxAttributeSource.java index 429767cd667..9f9f6381ca4 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationJmxAttributeSource.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationJmxAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ import org.springframework.lang.Nullable; import org.springframework.util.StringValueResolver; /** - * Implementation of the {@code JmxAttributeSource} interface that + * Implementation of the {@link JmxAttributeSource} interface that * reads annotations and exposes the corresponding attributes. * * @author Rob Harrop diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationMBeanExporter.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationMBeanExporter.java index 7ef741839d6..f0951d11b42 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationMBeanExporter.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationMBeanExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import org.springframework.jmx.export.naming.MetadataNamingStrategy; /** * Convenient subclass of Spring's standard {@link MBeanExporter}, - * activating Java 5 annotation usage for JMX exposure of Spring beans: + * activating annotation usage for JMX exposure of Spring beans: * {@link ManagedResource}, {@link ManagedAttribute}, {@link ManagedOperation}, etc. * *

Sets a {@link MetadataNamingStrategy} and a {@link MetadataMBeanInfoAssembler} diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java index 2912aa74248..708c1f9f549 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java @@ -27,7 +27,8 @@ import org.springframework.jmx.support.MetricType; /** * Method-level annotation that indicates to expose a given bean property as a * JMX attribute, with added descriptor properties to indicate that it is a metric. - * Only valid when used on a JavaBean getter. + * + *

Only valid when used on a JavaBean getter. * * @author Jennifer Hickey * @since 3.0 diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotification.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotification.java index 1a4f933e942..e4d0a349c6a 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotification.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,10 +27,12 @@ import java.lang.annotation.Target; /** * Type-level annotation that indicates a JMX notification emitted by a bean. * - *

As of Spring Framework 4.2.4, this annotation is declared as repeatable. + *

This annotation is a {@linkplain java.lang.annotation.Repeatable repeatable} + * annotation. * * @author Rob Harrop * @since 2.0 + * @see ManagedNotifications * @see org.springframework.jmx.export.metadata.ManagedNotification */ @Target(ElementType.TYPE) diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotifications.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotifications.java index 3ba09dd72a8..d9cbf5747af 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotifications.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotifications.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,12 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Type-level annotation that indicates JMX notifications emitted by a bean, - * containing multiple {@link ManagedNotification ManagedNotifications}. + * Type-level annotation used as a container for one or more + * {@code @ManagedNotification} declarations. + * + *

Note, however, that use of the {@code @ManagedNotifications} container + * is completely optional since {@code @ManagedNotification} is a + * {@linkplain java.lang.annotation.Repeatable repeatable} annotation. * * @author Rob Harrop * @since 2.0 diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperation.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperation.java index 536f01d6cc9..d82d41069b1 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperation.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +23,11 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Method-level annotation that indicates to expose a given method as a - * JMX operation, corresponding to the {@code ManagedOperation} attribute. - * Only valid when used on a method that is not a JavaBean getter or setter. + * Method-level annotation that indicates to expose a given method as a JMX operation, + * corresponding to the {@link org.springframework.jmx.export.metadata.ManagedOperation} + * attribute. + * + *

Only valid when used on a method that is not a JavaBean getter or setter. * * @author Rob Harrop * @since 1.2 diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java index 1b984360806..e15bd9d00b4 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,15 +24,15 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Method-level annotation used to provide metadata about operation parameters, - * corresponding to a {@code ManagedOperationParameter} attribute. - * Used as part of a {@link ManagedOperationParameters} annotation. + * Method-level annotation used to provide metadata about operation parameters, corresponding + * to a {@link org.springframework.jmx.export.metadata.ManagedOperationParameter} attribute. * - *

As of Spring Framework 4.2.4, this annotation is declared as repeatable. + *

This annotation is a {@linkplain java.lang.annotation.Repeatable repeatable} + * annotation. * * @author Rob Harrop * @since 1.2 - * @see ManagedOperationParameters#value + * @see ManagedOperationParameters * @see org.springframework.jmx.export.metadata.ManagedOperationParameter */ @Target(ElementType.METHOD) diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameters.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameters.java index ab9b6b0a97a..0ccf57a8205 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameters.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,12 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Method-level annotation used to provide metadata about operation parameters, - * corresponding to an array of {@code ManagedOperationParameter} attributes. + * Method-level annotation used as a container for one or more + * {@code @ManagedOperationParameter} declarations. + * + *

Note, however, that use of the {@code @ManagedOperationParameters} container + * is completely optional since {@code @ManagedOperationParameter} is a + * {@linkplain java.lang.annotation.Repeatable repeatable} annotation. * * @author Rob Harrop * @since 1.2 diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedResource.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedResource.java index 6535f441099..515201787b6 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedResource.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +26,8 @@ import java.lang.annotation.Target; import org.springframework.core.annotation.AliasFor; /** - * Class-level annotation that indicates to register instances of a class - * with a JMX server, corresponding to the {@code ManagedResource} attribute. + * Class-level annotation that indicates to register instances of a class with a JMX server, + * corresponding to the {@link org.springframework.jmx.export.metadata.ManagedResource} attribute. * *

Note: This annotation is marked as inherited, allowing for generic * management-aware base classes. In such a scenario, it is recommended to diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/package-info.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/package-info.java index b413ea5df18..ee176795f64 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/package-info.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/package-info.java @@ -1,7 +1,8 @@ /** - * Java 5 annotations for MBean exposure. - * Hooked into Spring's JMX export infrastructure - * via a special JmxAttributeSource implementation. + * Annotations for MBean exposure. + * + *

Hooked into Spring's JMX export infrastructure via a special + * {@link org.springframework.jmx.export.metadata.JmxAttributeSource} implementation. */ @NonNullApi @NonNullFields