I'm not the spec expert but I would say no, or it would be impossible to have read-only jmx access to something you want a java setter for.
David you're right.
However the read or write capability is handled by the isReadable/isWritable members of the base MBeanAttributeInfo.
Hmmm... thinking a bit more... there's a lot in MMBeans that don't make sense to me but the getMethod and setMethod descriptor fields would make even less sense if there was a fallback to reflection when they weren't defined.
I'll remove the fallback.
yes david is right, you should not fallback to reflection in case of attributes
Juha, another one.
DescriptorSupport.getFieldValue() has a FIXME about null or empty strings.
I'm expecting it to return null if the descriptor field is not defined. Is that a correct assumption to continue with?
yep, null is right
Looking further... the xmbean dtd has both access= READ|WRITE|READ_WRITE and the getmethod and setmethod.
This is redundant. I'd like to drop the access attribute and just use the explicit method names. OK?
> Looking further... the xmbean dtd has both access=
> READ|WRITE|READ_WRITE and the getmethod and
> This is redundant. I'd like to drop the access
> attribute and just use the explicit method names. OK?
Are you sure it's redundant? It's perfectly valid to have ModelMBean attributes that don't have a getter or setter method isn't it?
Yes. I'm saying that:
READ <-> getMethod != null & setMethod == null
WRITE <-> getMethod == null & setMethod != null
READ_WRITE <-> getMethod != null & setMethod != null
NOT_REALLY AN_ATTRIBUTE <-> getMethod == null & setMethod == null
So lets drop the access, it can be determined from the get and set method attributes, leading I think to simpler code...
> So lets drop the access, it can be determined from
> the get and set method attributes, leading I think to
> simpler code...
David, getMethod and setMethod are *optional* ModelMBeanAttributeInfo descriptor fields.
The bottom of page 85 and top of 86 of the spec outlines how set/getMethod is interpreted. My understanding is that ModelMBean attributes can exist quite easily without an underlying method(s) for invocation.
As such, READ/WRITE has nothing to do with getMethod or setMethod.
The light finally dawns... Of course you are completely correct.