[infinispan-dev] a nice HTML5 console for Infinispan & a question on MBean names...

Dennis Reed dereed at redhat.com
Wed Mar 20 15:13:43 EDT 2013


On 03/20/2013 10:03 AM, James Strachan wrote:
> On 19 March 2013 17:55, Dennis Reed <dereed at redhat.com> wrote:
>> This is an invalid use of the MBean names.
>>
>> The keys in an ObjectName are unordered.  It is a bug to depend on a
>> specific ordering of the keys.
> If the order really is unimportant then noone will mind if we change it :)

Unimportant isn't quite the right word here.  Undefined would be more 
accurate.
(As in it could be different every 3rd Tuesday that's rainy, and would 
still be a correct JMX implementation)

> Though really tools tend to assume a certain order.

Assuming an order on a set with an undefined order is often not going to 
work out well.  :)

Having a dependency on the order that one specific JMX implementation 
happens to currently return could easily break with any other
JMX implementation, even a minor JDK update, or even different 
conditions in the same implementation that you didn't expect.

> Though really most JMX related tools build trees from the MBean
> property names; so order dictates how the tree is drawn.

The only order that you can depend on is the "canonical" order from 
ObjectName.getCanonicalName().
Any ordering other than that must be done by the client.

-Dennis


More information about the infinispan-dev mailing list