-
1. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
davidjencks Feb 25, 2002 9:14 AM (in response to squirest)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.
-
2. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
squirest Feb 25, 2002 9:27 AM (in response to squirest)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.
Thanks,
Trev -
3. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
juha Feb 25, 2002 10:06 AM (in response to squirest)yes david is right, you should not fallback to reflection in case of attributes
-
4. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
squirest Feb 25, 2002 12:27 PM (in response to squirest)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?
Trev -
5. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
juha Feb 25, 2002 2:09 PM (in response to squirest)yep, null is right
-
6. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
davidjencks Feb 26, 2002 11:22 AM (in response to squirest)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? -
7. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
squirest Feb 26, 2002 11:26 AM (in response to squirest)> 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?
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?
Trev -
8. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
davidjencks Feb 26, 2002 2:40 PM (in response to squirest)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... -
9. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
squirest Feb 26, 2002 2:49 PM (in response to squirest)> 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.
Terv -
10. Re: juha - ModelMBeanAttributeInfo Descriptor - set/getMetho
davidjencks Feb 26, 2002 3:55 PM (in response to squirest)The light finally dawns... Of course you are completely correct.