title: How to get data via MBean
body: <p>I'm implementing a servlet as a JMX manager that runs in the same instance of Tomcat that all of the monitored servlets are running in. I can see the data of the monitored servlets when I open JConsole. From within my manager servlet I can enumerate all of the available standard MBeans, including the ones I've created in the monitored servlets, using this code like this:</p>
  
  <pre><code>JMXServiceURL url = new JMXServiceURL(        "service:jmx:rmi://localhost:1099/jndi/rmi://localhost:1099/jmxrmi" );
  
  mConnector = JMXConnectorFactory.connect( url );
  mMBSC = mConnector.getMBeanServerConnection();
  mObjectName = new ObjectName( "com.blahCompany.blah.blah:type=BlahBlah" );
  
  // just looking for one specific bean
  Set&lt;ObjectName&gt; myMbean = mMBSC.queryNames( mObjectName, null );
  
  if( myMBean.size() == 1 ) // I know it exists
  {
       MBeanInfo mbeanInfo = mMBSC.getMBeanInfo( &lt;ObjectName extracted from Set&gt; );
       MBeanAttributeInfo[] mbeanAttributeInfos = mbeanInfo.getAttributes();
  
       for( MBeanAttributeInfo attribInfo : mbeanAttributeInfos )
       {
           if( attribInfo.isReadable() )
           {
               String attribName = attribInfo.getName();
               String attribReturnType = attribInfo.getType();
  
               // The data's somewhere ... where????
               // In the MBeanInfo?
               // In the MBeanAttributeInfo??
           }
       }
  }
  </code></pre>
  
  <p>The problem is I don't know how to actually extract the <em>data</em> from these MBeans. The answer must be godawful obvious because no one else seems to have asked, but I do have a gift for overlooking the obvious. Your help will be gratefully appreciated.</p>
  
  <p>Bill</p>