1 Reply Latest reply on Oct 28, 2003 6:17 AM by Adrian Brock

    MBeanProxy Vs MBeanServer.getAttribute

    Yoge Newbie

      Which is the efficient way to access MBean Attributes ??

      What is the advantage in using MBeanProxy to access the MBean information?

      Will the below code snippet be efficient or should I go for direct mbeanserver.getAttribute ?
      ---------------------------------------------------------------------
      MBeanServer server=(MBeanServer )((java.util.ArrayList)MBeanServerFactory.findMBeanServer(null)).get(0);

      ObjectName oname=new ObjectName("jboss.management.local:j2eeType=J2EEServer,name=Local");

      J2EEServerMBean mbean = (J2EEServerMBean)MBeanProxy.get(J2EEServerMBean.class, oname, server);

      mbean.getServerVersion();
      ---------------------------------------------------------------------

      Is there any other efficient way to access the MBean Attributes within the JVM?


      Thanks

      Yoge