Exposing a POJO as a JMX MBean with Spring

Discussions

News: Exposing a POJO as a JMX MBean with Spring

  1. Exposing a POJO as a JMX MBean with Spring (2 messages)

    Often it might be necessary to expose a Plain Old Java Object as a JMX MBean for monitoring and management. Exposing a Plain Old Java Object as a JMX MBean is quite easy using the Spring framework's support. In this tutorial, we provide examples on how to do this, along with some tips and pitfalls to avoid. Check out the tutorial at the following URL:

    JavaCodeGeeks: Exposing a POJO as a JMX MBean with Spring

    Threaded Messages (2)

  2. The example is just way too long. Why not use annotation config, with annotation JMX export (two lines in the xml) and @ManagedResource (one line for the class) @ManagedAttribute and @ManagedOperation (1-1 lines for methods/attrs)? I'm using it for years and works like a charm.

  3. works for me[ Go to top ]

    I disagree. I was able easily cut and paste the xml into my existing config.

    It allowed me to easily expose just one bean, that already is in good enough shape to be managed:


        <bean id="executorService" class="java.util.concurrent.Executors" factory-method="newFixedThreadPool"
            destroy-method="shutdownNow">
            <constructor-arg value="${number.workers}" />
        </bean>

    No way I could have used annotations there!