Thursday, 9 February 2012

Exposing variables by JMX in Spring Applications

If you wish to expose variable by JMX in the Spring application you have to:
  1. Add in the spring context the tag:
    <context:mbean-export/>
  2. On the managed class add annotation @ManagedResource
  3. On this method you want to be exposed add annotation
    • For getters and setters - @ManagedAttribute
    • For all type of operations - @ManagedOperation

No comments: