Class AnnotationJmxAttributeSource
java.lang.Object
org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,JmxAttributeSource
public class AnnotationJmxAttributeSource
extends Object
implements JmxAttributeSource, BeanFactoryAware
Implementation of the
JmxAttributeSource
interface that
reads annotations and exposes the corresponding attributes.- Since:
- 1.2
- Author:
- Rob Harrop, Juergen Hoeller, Jennifer Hickey, Stephane Nicoll
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetManagedAttribute
(Method method) Implementations should return an instance ofManagedAttribute
if the suppliedMethod
has the corresponding metadata.getManagedMetric
(Method method) Implementations should return an instance ofManagedMetric
if the suppliedMethod
has the corresponding metadata.getManagedNotifications
(Class<?> clazz) Implementations should return an array ofManagedNotifications
if the suppliedClass
has the corresponding metadata.getManagedOperation
(Method method) Implementations should return an instance ofManagedOperation
if the suppliedMethod
has the corresponding metadata.getManagedOperationParameters
(Method method) Implementations should return an array ofManagedOperationParameters
if the suppliedMethod
has the corresponding metadata.getManagedResource
(Class<?> beanClass) Implementations should return an instance ofManagedResource
if the suppliedClass
has the corresponding metadata.void
setBeanFactory
(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
-
Constructor Details
-
AnnotationJmxAttributeSource
public AnnotationJmxAttributeSource()
-
-
Method Details
-
setBeanFactory
Description copied from interface:BeanFactoryAware
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.- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Parameters:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- See Also:
-
getManagedResource
public @Nullable ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an instance ofManagedResource
if the suppliedClass
has the corresponding metadata.- Specified by:
getManagedResource
in interfaceJmxAttributeSource
- Parameters:
beanClass
- the class to read the resource data from- Returns:
- the resource, or
null
if not found - Throws:
InvalidMetadataException
- in case of invalid metadata
-
getManagedAttribute
public @Nullable ManagedAttribute getManagedAttribute(Method method) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an instance ofManagedAttribute
if the suppliedMethod
has the corresponding metadata.- Specified by:
getManagedAttribute
in interfaceJmxAttributeSource
- Parameters:
method
- the method to read the attribute data from- Returns:
- the attribute, or
null
if not found - Throws:
InvalidMetadataException
- in case of invalid metadata
-
getManagedMetric
Description copied from interface:JmxAttributeSource
Implementations should return an instance ofManagedMetric
if the suppliedMethod
has the corresponding metadata.- Specified by:
getManagedMetric
in interfaceJmxAttributeSource
- Parameters:
method
- the method to read the metric data from- Returns:
- the metric, or
null
if not found - Throws:
InvalidMetadataException
- in case of invalid metadata
-
getManagedOperation
public @Nullable ManagedOperation getManagedOperation(Method method) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an instance ofManagedOperation
if the suppliedMethod
has the corresponding metadata.- Specified by:
getManagedOperation
in interfaceJmxAttributeSource
- Parameters:
method
- the method to read the operation data from- Returns:
- the operation, or
null
if not found - Throws:
InvalidMetadataException
- in case of invalid metadata
-
getManagedOperationParameters
public @Nullable ManagedOperationParameter[] getManagedOperationParameters(Method method) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an array ofManagedOperationParameters
if the suppliedMethod
has the corresponding metadata.- Specified by:
getManagedOperationParameters
in interfaceJmxAttributeSource
- Parameters:
method
- theMethod
to read the metadata from- Returns:
- the parameter information, or an empty array if no metadata is found
- Throws:
InvalidMetadataException
- in case of invalid metadata
-
getManagedNotifications
public @Nullable ManagedNotification[] getManagedNotifications(Class<?> clazz) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an array ofManagedNotifications
if the suppliedClass
has the corresponding metadata.- Specified by:
getManagedNotifications
in interfaceJmxAttributeSource
- Parameters:
clazz
- theClass
to read the metadata from- Returns:
- the notification information, or an empty array if no metadata is found
- Throws:
InvalidMetadataException
- in case of invalid metadata
-