Top Description Fields Constructors Methods
org.springframework.jmx.export.annotation

public Class AnnotationJmxAttributeSource

extends Object
implements JmxAttributeSource, BeanFactoryAware
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.Aware, org.springframework.jmx.export.metadata.JmxAttributeSource
Imports
java.lang.annotation.Annotation, java.lang.reflect.AnnotatedElement, .Array, .Method, .Modifier, java.util.ArrayList, .List, .Map, java.util.stream.Collectors, org.springframework.beans.BeanUtils, .BeanWrapper, .MutablePropertyValues, .PropertyAccessorFactory, .PropertyValue, org.springframework.beans.factory.BeanFactory, .BeanFactoryAware, org.springframework.beans.factory.config.ConfigurableBeanFactory, .EmbeddedValueResolver, org.springframework.core.annotation.MergedAnnotation, .MergedAnnotationPredicates, .MergedAnnotations, .MergedAnnotations.SearchStrategy, .RepeatableContainers, org.springframework.jmx.export.metadata.InvalidMetadataException, .JmxAttributeSource, org.springframework.lang.Nullable, org.springframework.util.StringValueResolver

Implementation of the JmxAttributeSource interface that reads annotations and exposes the corresponding attributes.
Authors
Rob Harrop, Juergen Hoeller, Jennifer Hickey, Stephane Nicoll
Since
1.2
See Also
ManagedResource, ManagedAttribute, ManagedOperation

Field Summary

Modifier and TypeField and Description
private StringValueResolver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static <T> T
copyPropertiesToBean(MergedAnnotation<? extends Annotation> ann, Class<T> beanClass)

private static <T> T[]
public ManagedAttribute
getManagedAttribute(Method
the method to read the attribute data from
method
)

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedAttribute.

Implementations should return an instance of ManagedAttribute if the supplied Method has the corresponding metadata.
public ManagedMetric
getManagedMetric(Method
the method to read the attribute data from
method
)

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedMetric.

Implementations should return an instance of ManagedMetric if the supplied Method has the corresponding metadata.
public ManagedNotification[]
getManagedNotifications(Class<?>
the Class to read the metadata from
clazz
)

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedNotifications.

Implementations should return an array of ManagedNotifications if the supplied Class has the corresponding metadata.
public ManagedOperation
getManagedOperation(Method
the method to read the attribute data from
method
)

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedOperation.

Implementations should return an instance of ManagedOperation if the supplied Method has the corresponding metadata.
public ManagedOperationParameter[]
getManagedOperationParameters(Method
the Method to read the metadata from
method
)

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedOperationParameters.

Implementations should return an array of ManagedOperationParameter if the supplied Method has the corresponding metadata.
public ManagedResource
getManagedResource(Class<?>
the class to read the attribute data from
beanClass
)

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedResource.

Implementations should return an instance of ManagedResource if the supplied Class has the appropriate metadata.
private static List<MergedAnnotation<? extends Annotation>>
getRepeatableAnnotations(AnnotatedElement annotatedElement, Class<? extends Annotation> annotationType, Class<? extends Annotation> containerAnnotationType)

public void
setBeanFactory(BeanFactory
owning BeanFactory (never null). The bean can immediately call methods on the factory.
beanFactory
)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Callback that supplies the owning factory to a bean instance.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

embeddedValueResolverback to summary
private StringValueResolver embeddedValueResolver
Annotations
@Nullable

Constructor Detail

AnnotationJmxAttributeSourceback to summary
public AnnotationJmxAttributeSource()

Method Detail

copyPropertiesToBeanback to summary
private static <T> T copyPropertiesToBean(MergedAnnotation<? extends Annotation> ann, Class<T> beanClass)
Annotations
@Nullable
copyPropertiesToBeanArrayback to summary
private static <T> T[] copyPropertiesToBeanArray(List<MergedAnnotation<? extends Annotation>> anns, Class<T> beanClass)
Annotations
@SuppressWarnings:unchecked
getManagedAttributeback to summary
public ManagedAttribute getManagedAttribute(Method method) throws InvalidMetadataException

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedAttribute.

Doc from org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedAttribute.

Implementations should return an instance of ManagedAttribute if the supplied Method has the corresponding metadata. Otherwise, should return null.

Parameters
method:Method

the method to read the attribute data from

Returns:ManagedAttribute

the attribute, or null if not found

Annotations
@Override
@Nullable
Exceptions
InvalidMetadataException:
in case of invalid attributes
getManagedMetricback to summary
public ManagedMetric getManagedMetric(Method method) throws InvalidMetadataException

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedMetric.

Doc from org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedMetric.

Implementations should return an instance of ManagedMetric if the supplied Method has the corresponding metadata. Otherwise, should return null.

Parameters
method:Method

the method to read the attribute data from

Returns:ManagedMetric

the metric, or null if not found

Annotations
@Override
@Nullable
Exceptions
InvalidMetadataException:
in case of invalid attributes
getManagedNotificationsback to summary
public ManagedNotification[] getManagedNotifications(Class<?> clazz) throws InvalidMetadataException

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedNotifications.

Doc from org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedNotifications.

Implementations should return an array of ManagedNotifications if the supplied Class has the corresponding metadata. Otherwise, should return an empty array.

Parameters
clazz:Class<?>

the Class to read the metadata from

Returns:ManagedNotification[]

the notification information

Annotations
@Override
Exceptions
InvalidMetadataException:
in the case of invalid metadata
getManagedOperationback to summary
public ManagedOperation getManagedOperation(Method method) throws InvalidMetadataException

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedOperation.

Doc from org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedOperation.

Implementations should return an instance of ManagedOperation if the supplied Method has the corresponding metadata. Otherwise, should return null.

Parameters
method:Method

the method to read the attribute data from

Returns:ManagedOperation

the attribute, or null if not found

Annotations
@Override
@Nullable
Exceptions
InvalidMetadataException:
in case of invalid attributes
getManagedOperationParametersback to summary
public ManagedOperationParameter[] getManagedOperationParameters(Method method) throws InvalidMetadataException

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedOperationParameters.

Doc from org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedOperationParameters.

Implementations should return an array of ManagedOperationParameter if the supplied Method has the corresponding metadata. Otherwise, should return an empty array if no metadata is found.

Parameters
method:Method

the Method to read the metadata from

Returns:ManagedOperationParameter[]

the parameter information.

Annotations
@Override
Exceptions
InvalidMetadataException:
in the case of invalid attributes.
getManagedResourceback to summary
public ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException

Implements org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedResource.

Doc from org.springframework.jmx.export.metadata.JmxAttributeSource.getManagedResource.

Implementations should return an instance of ManagedResource if the supplied Class has the appropriate metadata. Otherwise, should return null.

Parameters
beanClass:Class<?>

the class to read the attribute data from

Returns:ManagedResource

the attribute, or null if not found

Annotations
@Override
@Nullable
Exceptions
InvalidMetadataException:
in case of invalid attributes
getRepeatableAnnotationsback to summary
private static List<MergedAnnotation<? extends Annotation>> getRepeatableAnnotations(AnnotatedElement annotatedElement, Class<? extends Annotation> annotationType, Class<? extends Annotation> containerAnnotationType)
setBeanFactoryback to summary
public void setBeanFactory(BeanFactory beanFactory)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Doc from org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean#afterPropertiesSet() or a custom init-method.

Parameters
beanFactory:BeanFactory

owning BeanFactory (never null). The bean can immediately call methods on the factory.

Annotations
@Override