org.springframework.jmx.export.annotation

## 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 JDK 1.5+ annotations and exposes the corresponding attributes.
  Since:
    1.2
  Author:
    Rob Harrop, Juergen Hoeller, Jennifer Hickey
  See Also:
    `ManagedResource`, `ManagedAttribute`, `ManagedOperation`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationJmxAttributeSource()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ManagedAttribute` | `getManagedAttribute(Method method)` Implementations should return an instance of `ManagedAttribute` if the supplied `Method` has the corresponding metadata.
    `ManagedMetric` | `getManagedMetric(Method method)` Implementations should return an instance of `ManagedMetric` if the supplied `Method` has the corresponding metadata.
    `ManagedNotification[]` | `getManagedNotifications(Class<?> clazz)` Implementations should return an array of `ManagedNotifications` if the supplied the `Class` has the corresponding metadata.
    `ManagedOperation` | `getManagedOperation(Method method)` Implementations should return an instance of `ManagedOperation` if the supplied `Method` has the corresponding metadata.
    `ManagedOperationParameter[]` | `getManagedOperationParameters(Method method)` Implementations should return an array of `ManagedOperationParameter` if the supplied `Method` has the corresponding metadata.
    `ManagedResource` | `getManagedResource(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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AnnotationJmxAttributeSource

          public AnnotationJmxAttributeSource()

  - ### Method Detail

    - #### setBeanFactory

          public void setBeanFactory(BeanFactory beanFactory)

      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 interface `BeanFactoryAware`
      Parameters:
        `beanFactory` - owning BeanFactory (never `null`). The bean can immediately call methods on the factory.
      See Also:
        `BeanInitializationException`

    - #### getManagedResource

          public ManagedResource getManagedResource(Class<?> beanClass)
                                             throws InvalidMetadataException

      Description copied from interface: `JmxAttributeSource`
      Implementations should return an instance of `ManagedResource` if the supplied `Class` has the appropriate metadata. Otherwise should return `null`.
      Specified by:
        `getManagedResource` in interface `JmxAttributeSource`
      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

          public ManagedAttribute getManagedAttribute(Method method)
                                               throws InvalidMetadataException

      Description copied from interface: `JmxAttributeSource`
      Implementations should return an instance of `ManagedAttribute` if the supplied `Method` has the corresponding metadata. Otherwise should return `null`.
      Specified by:
        `getManagedAttribute` in interface `JmxAttributeSource`
      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

          public ManagedMetric getManagedMetric(Method method)
                                         throws InvalidMetadataException

      Description copied from interface: `JmxAttributeSource`
      Implementations should return an instance of `ManagedMetric` if the supplied `Method` has the corresponding metadata. Otherwise should return `null`.
      Specified by:
        `getManagedMetric` in interface `JmxAttributeSource`
      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

          public ManagedOperation getManagedOperation(Method method)
                                               throws InvalidMetadataException

      Description copied from interface: `JmxAttributeSource`
      Implementations should return an instance of `ManagedOperation` if the supplied `Method` has the corresponding metadata. Otherwise should return `null`.
      Specified by:
        `getManagedOperation` in interface `JmxAttributeSource`
      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 of `ManagedOperationParameter` if the supplied `Method` has the corresponding metadata. Otherwise should return an empty array if no metadata is found.
      Specified by:
        `getManagedOperationParameters` in interface `JmxAttributeSource`
      Parameters:
        `method` - the `Method` 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 of `ManagedNotifications` if the supplied the `Class` has the corresponding metadata. Otherwise should return an empty array.
      Specified by:
        `getManagedNotifications` in interface `JmxAttributeSource`
      Parameters:
        `clazz` - the `Class` to read the metadata from
      Returns:
        the notification information
      Throws:
        `InvalidMetadataException` - in the case of invalid metadata