Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Loner;</p> <p>Your MXBean should be visible in JConsole as soon as you construct it, since the constructor calls <strong>registerMxBean()</strong> which registers the MBean with the platform MBeanServer. </p> <p>Assuming your JConsole is already running when the MBean is registered, JConsole's view of the MBean will be dictated by the first instance of the MBeanInfo that is generated on registration. Since you coded this as a <strong>DynamicMBean</strong>, I wonder if your intent was to periodically modify the MBeanInfo, but be aware that once a JConsole connection has retrieved the MBeanInfo for a registered bean, it will not refresh it. If the MBeanInfo changes, you must closed the connection in JConsole and open it again.</p> <p>Consequently, your issue may be outside the code you have supplied, or more simply put, when is the instance of <strong>BasicCMIRP_MxBean</strong> created ? </p> <p>Your comment about not seeing the bean until notifications start arriving makes me wonder if you mean that: A. You cannot see the MBean until notifications start arriving, in which case I would assume that there is some activation code that creates the instance when a [the first ?] notification arrives, or B. What you mean is that you cannot see specific properties of the MBean until notifications start arriving.</p> <p>Perhaps you could clarify the larger picture here.</p> <p>Some additional observations that may be unrelated:</p> <ol> <li>The MBeanInfo you are generating specifies that the one and only operation is called <strong>getBasicCMInstrumentation</strong> (basic), but your <em>invoke</em> handler only attempts to decode an operation called <strong>getBulkCMInstrumentation</strong> (bulk). JConsole is supplied the MBeanInfo in order to render the operations so the console believes that the operation is called <em>basic</em> but the MBean will only respond to a request called <em>bulk</em>.</li> <li>The signature for method <strong>getBasicCMInstrumentation</strong> returns an <strong>Object</strong> but what the code really returns is a <strong>String[]</strong>. This may work because your MBeanInfo specifies that a <em>String[]</em> is returned, but for consistency and clarity I would change the method signature.</li> </ol> <p>//Nicholas</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload