|
From: B. <jer...@xt...> - 2002-01-18 17:24:26
|
Bordet, Simone wrote:
>Hi Jerome,
>
>>>Hi Jerome,
>>>
>>>>>Ok, I thought some more on it, what about this ?
>>>>>
>>>>>/**
>>>>>* @openjmx:managed-attribute description="The status of this MBean"
>>>>>*/
>>>>>public int getStatus() {return 0;}
>>>>>/**
>>>>>* @openjmx:managed-attribute
>>>>>*/
>>>>>public void setStatus(int status) {}
>>>>>
>>>>>I specify always on getter the description information; I
>>>>>
>>>>just put the tag on the setter so that it will appear in the
>>>>MBean interface. I will do a small change to the code so that
>>>>getters are always processed before setters, so setters can
>>>>have no description; if the attribute is write-only, then the
>>>>setter will have the description.
>>>>
>>How can you deal with write-only attributes?
>>You would only have a setStatus method in the implementation with
>>no-comment??
>>
>
>No, see above... "if the attribute is write-only, then the setter will have the description."
>It's in the openjmx implementation that I will do the trick: if getter present take its description and ignore the setter's, if no getter take the setter's one. However the trick costs nothing and it's completely transparent.
>
Ok. This will make it easier for me. Thanks :-)
>>>>Where do you want to emit the warning? in the resulting
>>>>description? or
>>>>on screen during the build process?
>>>>The first option is easier and the later is more complex.
>>>>
>>>The later will be perfect ;)
>>>
>>I did my best in order to avoid writing some specific XDoclet
>>handlers
>>for OpenJMX but due to the logic we want to put in, I have no
>>choice :-(.
>>Sniff... More pain scheduled :-)
>>
>
>No choice othen than... implement the latter ;) ? Or what ?
>
I will have to make a custom handler for the warning (whether or not we
are trying to tell it's an operation when it's an attribute).
Anyway I have to because of the difficulty with indexes taken as
parameters on the methods. There is no way using regulars XDoclet tags
to solve this problem. Would I be allowed to extend the
MBeanDescriptionAdaptor in order to take as input the name of the
parameter? or do I have to solve this issue at source code generation time?
Jerome.
|