AnnotationJmxAttributeSource uses AnnotationUtils for consistent meta-annotation handling and diagnostics
Issue: SPR-12572
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -70,7 +70,7 @@ public class AnnotationJmxAttributeSource implements JmxAttributeSource, BeanFac
|
|||||||
@Override
|
@Override
|
||||||
public ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException {
|
public ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException {
|
||||||
org.springframework.jmx.export.annotation.ManagedResource ann =
|
org.springframework.jmx.export.annotation.ManagedResource ann =
|
||||||
beanClass.getAnnotation(org.springframework.jmx.export.annotation.ManagedResource.class);
|
AnnotationUtils.getAnnotation(beanClass, org.springframework.jmx.export.annotation.ManagedResource.class);
|
||||||
if (ann == null) {
|
if (ann == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ public class AnnotationJmxAttributeSource implements JmxAttributeSource, BeanFac
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ManagedNotification[] getManagedNotifications(Class<?> clazz) throws InvalidMetadataException {
|
public ManagedNotification[] getManagedNotifications(Class<?> clazz) throws InvalidMetadataException {
|
||||||
ManagedNotifications notificationsAnn = clazz.getAnnotation(ManagedNotifications.class);
|
ManagedNotifications notificationsAnn = AnnotationUtils.getAnnotation(clazz, ManagedNotifications.class);
|
||||||
if (notificationsAnn == null) {
|
if (notificationsAnn == null) {
|
||||||
return new ManagedNotification[0];
|
return new ManagedNotification[0];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user