|
From: Bordet, S. <Sim...@co...> - 2002-01-18 11:44:53
|
Hi Jerome
> Oups, wrong mailing-list...
No, it is something that may interest also the user's list :)
> Hi,
>=20
> I have finally finished a source code generator base on XDoclet. It is
> able to generate the MBean interface and the MBean=20
> description based on
> comment you put in the implementation source file.
Just sweet !
> I have attached to the following mail the MBean implementation with
> proper XDoclet comments.
> I have also attached the results of XDoclet on the=20
> implementation source.
Yes. But I have few questions:
1) there is a managed attribute "dummy", but no setDummy and getDummy in =
the MBean interface. Beware also of the fact that I can call the data =
member "m_dummy", does this impact the MBean interface (I don't want =
getm_dummy() ;) ? And also, beware of the fact that a "dummy" attribute =
*must* generate a getdummy() and setdummy(), not getDummy() and =
setDummy(). Can I specify if it's read-only ?
2) just for consistency with JMX, i would change "managed-method" to =
"managed-operation"
3) setStatus is an attribute, not an operation. Is there a way to =
enforce check of this kind of mistakes ? If a method is described as =
operation, but it's an attribute, can i know this when I'm generating =
the code with XDoclet ?
4) I see that the parameter information for operations is not included, =
it's just because start() has no parameters ?
Well, it's a great job, Jerome !
Let me know if you need clarification on the questions above, but I =
guess the xdoclet generation will rock !
I didn't know that XDoclet became so powerful.
> I had to patch XDoclet because the template engine does not=20
> support yet
> constructors. I am working with one of the XDoclet administrator in
> order to put my modifications into CVS.
> If you want to use it for now on, send me a mail and I will=20
> send you the
> modified xdoclet.jar file.
Ok !
> If we want to add this features to OpenJMX (I think this is a really
> nice thing),=20
Absolutely agree !
> let me know where in the distribution I should do so...
Ok, let me play a bit with CVS, I will tell you soon.
If you have time, can you write a document on this beautiful feauture, =
when will be ready ?
If you don't have time just tell, we must absolutely write something =
about for users.
Thanks
Simon
> Below is an extract of the ant stuff you need to add before=20
> compilation:
> <taskdef name=3D"templatedoclet" classname=3D"xdoclet.DocletTask">
> <classpath refid=3D"xdoclet"/>
> </taskdef>
>=20
> <!-- Generate the MBean sources -->
> <templatedoclet sourcepath=3D"${src}" destdir=3D"${src}"
> classpathref=3D"xdoclet" force=3D"yes">
> <fileset dir=3D"${src}">
> <include name=3D"com/xtremejava/webos/jmx/MyService.java"/>
> </fileset>
> <template templateFile=3D"${src}/mbean.j"
> destinationFile=3D"{0}MBean.java" havingClassTag=3D"openjmx:mbean"/>
> </templatedoclet>
> <!-- Generate the MBeanDescription sources -->
> <templatedoclet sourcepath=3D"${src}" destdir=3D"${src}"
> classpathref=3D"xdoclet" force=3D"yes">
> <fileset dir=3D"${src}">
> <include name=3D"com/xtremejava/webos/jmx/MyService.java"/>
> </fileset>
> <template templateFile=3D"${src}/mbean-description.j"
> destinationFile=3D"{0}MBeanDescription.java"=20
> havingClassTag=3D"openjmx:mbean"/>
> </templatedoclet>
>=20
>=20
|