|
From: B. <jer...@xt...> - 2002-01-18 16:45:21
|
Bordet, Simone wrote:
>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??
>>I have attached another proposition I have. There is the
>>implementation
>>(a little bit more complex than before) and the resulting
>>interface and
>>description.
>>I am now trying to verify if there are the getter/setter methods.
>>
>
>-1 :)
>Because you have to specify at class level the attribute name, which in case of renaming is a pain...
>I still prefer my solution.
>
Ok. As soon as I will have understood how to deal with write-only
attribute, I will make changes in your way.
>>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 :-)
BTW, the project administrator of XDoclet has commited my patch. YES!!!!
At least we won't have to use a modified XDoclet release :-)
So to conclude, when I have the clarifications about WO attributes, I
will update the templates and start coding the custom handlers...
Jerome.
|