2 Replies Latest reply on Aug 9, 2005 4:09 AM by vinaypurohit

    Accessing the JBossBossManagedConnectionPool MBean

    vinaypurohit

      Hi,

      I have an application deployed on Weblogic that I am migrating to JBOSS 4.0.2.

      As part of the application, I access the Weblogic MBean Server to access connection pool information and perform operations on the connection pool
      programatically.

      Psuedo Code:
      // Get Inital context
      // Get the MBeanHome using IntialContext
      // Get the weblogic.management.configuration.JDBCConnectionPoolMBean and weblogic.management.runtime.JDBCConnectionPoolRuntimeMBean
      // from the MBeanHome
      // Call either the shrink() or the reset() methods on the JDBCConnectionPoolRuntimeMBean
      // Call the methods on the JDBCConnectionPoolMBean to get pool properties


      I would like to migrate this functionality to JBOSS
      For Jboss, I had a look at the JMX Console (ManagedConnectionPool).

      Right now, I am accessing the JBOSS Mbean Server though a utility class that makes use of the JMX-Console classes (org.jboss.jmx.adaptor.control.Server, org.jboss.jmx.adaptor.control.OpResultInfo etc.)

      I pass the the names as "jboss.jca:service=ManagedConnectionPool,*" to retrieve connection pool information
      and perform operations (flush, stop etc.) on the pools by calling the
      Server.invokeOpByName method, to which I pass the operation names.

      The question is, like in Weblogic- Is there a way I can directly access the object of
      org.jboss.resource.connectionmanager.JBossManagedConnectionPool and call operations on the same

      Psuedo Code:
      //JBossManagedConnectionPool pool = //get access to the object
      //pool.flush()
      or
      //pool.stop()


      cheers
      vinay