public class AnnotationJmxAttributeSource extends java.lang.Object implements JmxAttributeSource, BeanFactoryAware
JmxAttributeSource
interface that
reads annotations and exposes the corresponding attributes.ManagedResource
,
ManagedAttribute
,
ManagedOperation
Constructor and Description |
---|
AnnotationJmxAttributeSource() |
Modifier and Type | Method and Description |
---|---|
ManagedAttribute |
getManagedAttribute(java.lang.reflect.Method method)
Implementations should return an instance of
ManagedAttribute
if the supplied Method has the corresponding metadata. |
ManagedMetric |
getManagedMetric(java.lang.reflect.Method method)
Implementations should return an instance of
ManagedMetric
if the supplied Method has the corresponding metadata. |
ManagedNotification[] |
getManagedNotifications(java.lang.Class<?> clazz)
Implementations should return an array of
ManagedNotifications
if the supplied the Class has the corresponding metadata. |
ManagedOperation |
getManagedOperation(java.lang.reflect.Method method)
Implementations should return an instance of
ManagedOperation
if the supplied Method has the corresponding metadata. |
ManagedOperationParameter[] |
getManagedOperationParameters(java.lang.reflect.Method method)
Implementations should return an array of
ManagedOperationParameter
if the supplied Method has the corresponding metadata. |
ManagedResource |
getManagedResource(java.lang.Class<?> beanClass)
Implementations should return an instance of
ManagedResource
if the supplied Class has the appropriate metadata. |
void |
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
public void setBeanFactory(BeanFactory beanFactory)
BeanFactoryAware
Invoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.
setBeanFactory
in interface BeanFactoryAware
beanFactory
- owning BeanFactory (never null
).
The bean can immediately call methods on the factory.BeanInitializationException
@Nullable public ManagedResource getManagedResource(java.lang.Class<?> beanClass) throws InvalidMetadataException
JmxAttributeSource
ManagedResource
if the supplied Class
has the appropriate metadata.
Otherwise should return null
.getManagedResource
in interface JmxAttributeSource
beanClass
- the class to read the attribute data fromnull
if not foundInvalidMetadataException
- in case of invalid attributes@Nullable public ManagedAttribute getManagedAttribute(java.lang.reflect.Method method) throws InvalidMetadataException
JmxAttributeSource
ManagedAttribute
if the supplied Method
has the corresponding metadata.
Otherwise should return null
.getManagedAttribute
in interface JmxAttributeSource
method
- the method to read the attribute data fromnull
if not foundInvalidMetadataException
- in case of invalid attributes@Nullable public ManagedMetric getManagedMetric(java.lang.reflect.Method method) throws InvalidMetadataException
JmxAttributeSource
ManagedMetric
if the supplied Method
has the corresponding metadata.
Otherwise should return null
.getManagedMetric
in interface JmxAttributeSource
method
- the method to read the attribute data fromnull
if not foundInvalidMetadataException
- in case of invalid attributes@Nullable public ManagedOperation getManagedOperation(java.lang.reflect.Method method) throws InvalidMetadataException
JmxAttributeSource
ManagedOperation
if the supplied Method
has the corresponding metadata.
Otherwise should return null
.getManagedOperation
in interface JmxAttributeSource
method
- the method to read the attribute data fromnull
if not foundInvalidMetadataException
- in case of invalid attributespublic ManagedOperationParameter[] getManagedOperationParameters(java.lang.reflect.Method method) throws InvalidMetadataException
JmxAttributeSource
ManagedOperationParameter
if the supplied Method
has the corresponding metadata. Otherwise
should return an empty array if no metadata is found.getManagedOperationParameters
in interface JmxAttributeSource
method
- the Method
to read the metadata fromInvalidMetadataException
- in the case of invalid attributes.public ManagedNotification[] getManagedNotifications(java.lang.Class<?> clazz) throws InvalidMetadataException
JmxAttributeSource
ManagedNotifications
if the supplied the Class
has the corresponding metadata. Otherwise
should return an empty array.getManagedNotifications
in interface JmxAttributeSource
clazz
- the Class
to read the metadata fromInvalidMetadataException
- in the case of invalid metadata