Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-408

Expose classes, attributes and operations via @ManagedResource, @ManagedAttribute and @ManagedOperation

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Critical Critical
    • 2.7
    • 2.4
    • None
    • Medium

      We should be able to simply make an object expose management information by annotating it.
      Input: annotations and classes
      Output: classes which are registered with the platform MBeanServer at runtime using an API (which is also provided). This API
      uses the annotations and reflection to create DynamicMBeans (or MXBeans ?) which are then registered with the MBeanServer.

      Example:

      @ManagedResource(objectName="jgroups:type=protocol;name=UDP")
      public class UDP extends Protocol {

      @ManagedAttribute(name="Sent", descr="Number of bytes sent")
      long sent_msgs=0; // generates a 'public long getSent()' getter, no setter !

      @ManagedOperation(description="Prints statistics over the last N seconds")
      @Parameters(

      {@Parameter(name="timeframe", description="Number of milliseconds (0 for all stats)")}

      )
      public String printStats(long timeframe)

      { // implement; }

      }

              vblagoje Vladimir Blagojevic (Inactive)
              rhn-engineering-bban Bela Ban
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: