0 Replies Latest reply on Jan 20, 2010 3:40 PM by Giovanni Formenti

    MBeanProxyExt.create vs MBeanServerInvocationHandler.newProxyInstance performance

    Giovanni Formenti Newbie

      Hi,

      I know I already wrote this in another thread, but I had no response

      I'm trying to understand the difference between the two methods into the subject of this thread.

       

      I compare:

      MBeanServer server = MBeanServerLocator.locate();

      PhysicalSessionManagerMBean sessionManager = (PhysicalSessionManagerMBean) MBeanProxyExt.create(PhysicalSessionManagerMBean.class,"jboss.jmx:service=PhysicalSessionManager", server);

       

      with:

      MBeanServer server = MBeanServerLocator.locate();

      ObjectName on = new ObjectName("jboss.jmx:service=PhysicalSessionManager");
      PhysicalSessionManagerMBean sessionManager = (PhysicalSessionManagerMBean) MBeanServerInvocationHandler.newProxyInstance(server, on, PhysicalSessionManagerMBean.class,false);

       

      and after 400.000 calls I get an average response time of these 3 lines of code (newProxyInstance) of 0,3ms instead of 729ms (MBeanProxyExt.create)... quite stange from my incompetent (I have limited knowledge of JMX) point of view.

       

      Someone know the cause of these execution times huge difference? From a functional point of view, can I consider the two method equal?

      Thank you for any hits on this

       

      Regards

      Giovanni