activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Siegenthaler" <msiegentha...@inventsoft.ch>
Subject Re: DestinationStatistics
Date Wed, 10 Sep 2008 20:35:20 GMT
IIRC you should use a MBeanServerConnection and then
getAttribute(objectName, "enqueueCount") on it to get the value you're
looking for.
I you're surfing around on "reflection"-level, you get all the
information ABOUT the mbean, but not the actual mbean.

--Mario

On Wed, Sep 10, 2008 at 10:28 PM, Andruil <curtisbarrett2@hotmail.com> wrote:
>
> I'm so close that it is driving me nuts.
>
> After a bit of reading and experimenting what I've come up with is
>
> MBeanInfo mbi = getMBeanInfo(connection, new
> ObjectName("org.apache.activemq:BrokerName=localhost,Type=Queue,Destination=NewQueue"));
>
> for(MBeanAttributeInfo mbai : mbi.getAttributes())
> {
>
>        log.info("Name: " + mbai.getName() + ", Description: " +
> mbai.getDescription());
>        Descriptor d = mbai.getDescriptor();
>
>        for(String s : d.getFieldNames())
>        {
>                log.info("Name: " + s + ", Value: " + d.getFieldValue(s));
>        }
> }
>
>
> But for each of the MBeanAttributeInfos the getFieldNames returns an empty
> list.  From the names of the attributes this looks to be what I want
> (EnqueueCount, DequeueCount, etc).  Am I missing a step to retrieve the
> values?
>
> --
> View this message in context: http://www.nabble.com/DestinationStatistics-tp19397314p19422502.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>

Mime
View raw message