From b6d9fd39e6e29f94a90fe97959c33a9adb24c99b Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 25 Mar 2016 00:49:21 +0100 Subject: [PATCH] Support @ManagedNotification & @ManagedOperationParameter as merged annotations Issue: SPR-13973 --- .../jmx/export/annotation/AnnotationJmxAttributeSource.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 bb0a0abd00..9dc192a173 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 @@ -29,6 +29,7 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.beans.factory.config.EmbeddedValueResolver; +import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.jmx.export.metadata.InvalidMetadataException; import org.springframework.jmx.export.metadata.JmxAttributeSource; @@ -106,7 +107,7 @@ public class AnnotationJmxAttributeSource implements JmxAttributeSource, BeanFac public org.springframework.jmx.export.metadata.ManagedOperationParameter[] getManagedOperationParameters(Method method) throws InvalidMetadataException { - Set anns = AnnotationUtils.getRepeatableAnnotations( + Set anns = AnnotatedElementUtils.getMergedRepeatableAnnotations( method, ManagedOperationParameter.class, ManagedOperationParameters.class); return copyPropertiesToBeanArray(anns, org.springframework.jmx.export.metadata.ManagedOperationParameter.class); } @@ -115,7 +116,7 @@ public class AnnotationJmxAttributeSource implements JmxAttributeSource, BeanFac public org.springframework.jmx.export.metadata.ManagedNotification[] getManagedNotifications(Class clazz) throws InvalidMetadataException { - Set anns = AnnotationUtils.getRepeatableAnnotations( + Set anns = AnnotatedElementUtils.getMergedRepeatableAnnotations( clazz, ManagedNotification.class, ManagedNotifications.class); return copyPropertiesToBeanArray(anns, org.springframework.jmx.export.metadata.ManagedNotification.class); }