3 Replies Latest reply on Jun 19, 2008 4:57 AM by alesj

    How to expose attribute object as JMX

    timfox

      Hi-

      I have an object MessagingServer which is instantiate by the MC and declared in our jbm-beans.xml file.

      This object has an attribute MessagingServerManagement which is itself an interface that provides the management interface of the messaging server.

      That interface contains a set of operations, e.g.

      interface MessagingServerManagement
      {
       void foo();
       void bar();
      }
      


      I want the MC to automatically expose those management operations as JMX operations.

      I know how to do this in the case the actual MessagingServerManagement is declared as a top level bean in its own right. (I.e. with @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.messaging:service=JMSServerManager",exposedInterface=org.jboss.messaging.jms.server.JMSServerManager.class))

      But in this case the interface I want to expose is an attribute of a bean, not a top level bean.

      Any ideas how to do this?




        • 1. Re: How to expose attribute object as JMX
          alesj

          Create a simple wrapper/delegate around MsgServerMgmnt interface, where all invocations delegate the work to MsgServer::getMsgServerMgmnt attribute.
          And then simply do @JMX as you already know.
          ;-)

          • 2. Re: How to expose attribute object as JMX
            timfox

             

            "alesj" wrote:
            Create a simple wrapper/delegate around MsgServerMgmnt interface, where all invocations delegate the work to MsgServer::getMsgServerMgmnt attribute.
            And then simply do @JMX as you already know.
            ;-)


            Yeah, I thought of this, but it seems pretty ugly. Would be nice if MC could do this automatically - an ability to use the JMX annotation on an attribute too.

            • 3. Re: How to expose attribute object as JMX
              alesj

               

              "timfox" wrote:

              Would be nice if MC could do this automatically - an ability to use the JMX annotation on an attribute too.

              Sounds reasonable to me.
              Open a design discussion on 'Design Microcontainer' forum, getting Adrian and others involved as well.