Class AnnotationJmxAttributeSource
java.lang.Object
org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,JmxAttributeSource
public class AnnotationJmxAttributeSource
extends Object
implements JmxAttributeSource, org.springframework.beans.factory.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
-
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 ofManagedOperationParameter
if the suppliedMethod
has the corresponding metadata.getManagedResource
(Class<?> beanClass) Implementations should return an instance ofManagedResource
if the suppliedClass
has the appropriate metadata.void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory)
-
Constructor Details
-
AnnotationJmxAttributeSource
public AnnotationJmxAttributeSource()
-
-
Method Details
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) - Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
-
getManagedResource
@Nullable public ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an instance ofManagedResource
if the suppliedClass
has the appropriate metadata. Otherwise, should returnnull
.- Specified by:
getManagedResource
in interfaceJmxAttributeSource
- Parameters:
beanClass
- the class to read the attribute data from- Returns:
- the attribute, or
null
if not found - Throws:
InvalidMetadataException
- in case of invalid attributes
-
getManagedAttribute
@Nullable public ManagedAttribute getManagedAttribute(Method method) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an instance ofManagedAttribute
if the suppliedMethod
has the corresponding metadata. Otherwise, should returnnull
.- 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 attributes
-
getManagedMetric
Description copied from interface:JmxAttributeSource
Implementations should return an instance ofManagedMetric
if the suppliedMethod
has the corresponding metadata. Otherwise, should returnnull
.- Specified by:
getManagedMetric
in interfaceJmxAttributeSource
- Parameters:
method
- the method to read the attribute data from- Returns:
- the metric, or
null
if not found - Throws:
InvalidMetadataException
- in case of invalid attributes
-
getManagedOperation
@Nullable public ManagedOperation getManagedOperation(Method method) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an instance ofManagedOperation
if the suppliedMethod
has the corresponding metadata. Otherwise, should returnnull
.- Specified by:
getManagedOperation
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 attributes
-
getManagedOperationParameters
public ManagedOperationParameter[] getManagedOperationParameters(Method method) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an array ofManagedOperationParameter
if the suppliedMethod
has the corresponding metadata. Otherwise, should return an empty array if no metadata is found.- Specified by:
getManagedOperationParameters
in interfaceJmxAttributeSource
- Parameters:
method
- theMethod
to read the metadata from- Returns:
- the parameter information.
- Throws:
InvalidMetadataException
- in the case of invalid attributes.
-
getManagedNotifications
public ManagedNotification[] getManagedNotifications(Class<?> clazz) throws InvalidMetadataException Description copied from interface:JmxAttributeSource
Implementations should return an array ofManagedNotifications
if the suppliedClass
has the corresponding metadata. Otherwise, should return an empty array.- Specified by:
getManagedNotifications
in interfaceJmxAttributeSource
- Parameters:
clazz
- theClass
to read the metadata from- Returns:
- the notification information
- Throws:
InvalidMetadataException
- in the case of invalid metadata
-