Hey,

Adrian Brock has been busily correcting code in JBoss which does something
like this:

mbeanserver.invoke(objectname, "getBlurdyAttribute", etc etc etc)

to call attribute getters and setters directly.

Just a heads-up for everyone - jboss-mx only allows you to call
invoke() on operations that actually appear in the list returned by the
MBeanInfo.getOperations() call.

Attribute getters and setters are *not* operations and do not appear in
that list.

While the RI has permitted the above usage it is a) contrary to the spec
and b) brittle because it assumes implementation details about the MBean
you are talking to.

The spec issue is discussed in the following mail on the jmx mailing list:

http://swjscmail1.java.sun.com/cgi-bin/wa?A2=ind0111&L=jmx-forum&P=R4891

It's worth bearing in mind that an attribute caled "Blurdy" may have a
getter called "a" and a setter called "b".  Heck it may have no getters or
setters at all.

The XMBean stuff in jboss-mx will allow you to choose exactly how you want
your methods to be exposed - i.e. you want getBlurdyAttribute to be an
operation rather than an attribute.

Thanks,
Trevor


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to