2 Replies Latest reply on Feb 26, 2002 8:18 PM by Greg Turner

    using same MBeans across Application servers

    sudheesh Newbie

      I know , that we can use the same MBeans across different Application servers, But each container provider like bea,websphere has implemented javax.management.MBeanServer interface in a different manner...
      So if i have to make use of mbean registration and lookup across differnt application servers , should i go about implementing the javax.management.MBeanServer interface ..
      like use the application server specific implementations..
      so like which is easier and is there any round abt way of doing this....
      being a product based company , i should ensure that my applicatin will run in any applicatioon server..

      pls let me know.....

        • 1. Re: using same MBeans across Application servers
          Adrian Brock Master

          You might want to do like Jetty.
          They have one MBean that speaks JBoss,
          i.e. it is a JBoss Service with all the lifecycle methods.
          This MBean then registers/unregisters the others.
          You will probably need one MBean for each appserver.

          Alternatively, look at Dynamic/ModelMBeans. It should be
          possible to expose different management interfaces
          depending on the AppServer.
          How you determine which server you are on is left as an
          exercise to the reader. MBeanServer.getDefaultDomain()?


          • 2. Re: using same MBeans across Application servers
            Greg Turner Apprentice

            I had the same requirement, to write some MBeans that have no vendor specific code in them. The way I did this is to write an additional MBean that does have JBoss specific code. I added code in the jboss.jcml file to load only this additional MBean. The startService() then instantiates my non JBoss MBeans and registers them with the server. Everything seems to work OK.