You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Kristian Köhler <Kr...@gmx.de> on 2003/08/15 23:26:14 UTC

[PATCH] XDoclet / JMXDoclet based MBean interface generation added to core module

Hi,

we extended the build process of the core module by including XDoclet / 
JMXDoclet based MBean interface generation. Using JMXDoclet all MBean 
interfaces can be created automatically based on meta information in the 
implementing classes hence avoiding tedious copy/paste duplication.

To do so we included the xdoclet plugin for maven as outlined in the 
xdoclet documentation (see 
http://xdoclet.sourceforge.net/maven-plugin.html), adjusted the build 
files for the core module accordingly, added meta information to all 
mbean implementors and removed the respective interfaces (which are now 
created when building via maven).

Here is how to make use of the functionality for a simple example (patch 
includes all changes of course :-)):

/**
  * @jmx.mbean
 */
public class ClassSpace extends URLClassLoader implements ClassSpaceMBean {
    public ClassSpace(URL[] urls) {
        super(urls);
    }

    /**
     * @jmx.managed-operation
     * @jmx.managed-parameter type="List" name="urls"  
     */
    public void addURLs(List urls) {
        for (Iterator i = urls.iterator(); i.hasNext();) {
            URL url = (URL) i.next();
            addURL(url);
        }
    }
}

Besides applying the patch, the following classes have to be removed:

org.apache.geronimo.deployment.DeploymentControllerMBean.java
org.apache.geronimo.deployment.DeploymentInfoMBean.java
org.apache.geronimo.deployment.loader.ClassSpaceMBean.java
org.apache.geronimo.deployment.repository.ComponentRepositoryMBean.java
org.apache.geronimo.deployment.scanner.DeploymentScannerMBean.java
org.apache.geronimo.deployment.service.ServiceDeploymentMBean.java
org.apache.geronimo.deployment.service.ServiceDeploymentPlannerMBean.java
org.apache.geronimo.jmx.RelationshipMBean.java

We hope someone will apply this patch,

cheers,

Steffen Schluff and Kristian Köhler


Re: [PATCH] XDoclet / JMXDoclet based MBean interface generation added to core module

Posted by Kristian Köhler <Kr...@gmx.de>.
Hi

Jeremy Boynes wrote:

>A couple of questions first...
>
>1) Do we want to introduce XDoclet into the build at this time?
>
I think it's never too early to introduce XDoclet ;-) .

OK. The introduction of XDoclet adds new complexity to the build process 
but in my opinion it's much better than do all the work twice.

Even in this early stage of the project there are many places where 
XDoclet is useful and i think there will be more and more in the future.

I think by including XDoclet later on you only delete work which you 
never had done if you included it earlier. ;-)

Kristian
<http://dict.leo.org/?p=lURE.&search=eliminated>

>
>2) Do we want to do this for these MBeans as they are likely to
>   change to ModelMBeans soon (Dain)?
>
>--
>Jeremy
>
>  
>
>>-----Original Message-----
>>From: Kristian Köhler [mailto:Kristian.Koehler@gmx.de]
>>Sent: Friday, August 15, 2003 2:26 PM
>>To: geronimo-dev@incubator.apache.org
>>Subject: [PATCH] XDoclet / JMXDoclet based MBean interface generation
>>added to core module
>>
>>
>>Hi,
>>
>>we extended the build process of the core module by including XDoclet /
>>JMXDoclet based MBean interface generation. Using JMXDoclet all MBean
>>interfaces can be created automatically based on meta information in the
>>implementing classes hence avoiding tedious copy/paste duplication.
>>
>>To do so we included the xdoclet plugin for maven as outlined in the
>>xdoclet documentation (see
>>http://xdoclet.sourceforge.net/maven-plugin.html), adjusted the build
>>files for the core module accordingly, added meta information to all
>>mbean implementors and removed the respective interfaces (which are now
>>created when building via maven).
>>
>>Here is how to make use of the functionality for a simple example (patch
>>includes all changes of course :-)):
>>
>>/**
>>  * @jmx.mbean
>> */
>>public class ClassSpace extends URLClassLoader implements
>>ClassSpaceMBean {
>>    public ClassSpace(URL[] urls) {
>>        super(urls);
>>    }
>>
>>    /**
>>     * @jmx.managed-operation
>>     * @jmx.managed-parameter type="List" name="urls"
>>     */
>>    public void addURLs(List urls) {
>>        for (Iterator i = urls.iterator(); i.hasNext();) {
>>            URL url = (URL) i.next();
>>            addURL(url);
>>        }
>>    }
>>}
>>
>>Besides applying the patch, the following classes have to be removed:
>>
>>org.apache.geronimo.deployment.DeploymentControllerMBean.java
>>org.apache.geronimo.deployment.DeploymentInfoMBean.java
>>org.apache.geronimo.deployment.loader.ClassSpaceMBean.java
>>org.apache.geronimo.deployment.repository.ComponentRepositoryMBean.java
>>org.apache.geronimo.deployment.scanner.DeploymentScannerMBean.java
>>org.apache.geronimo.deployment.service.ServiceDeploymentMBean.java
>>org.apache.geronimo.deployment.service.ServiceDeploymentPlannerMBean.java
>>org.apache.geronimo.jmx.RelationshipMBean.java
>>
>>We hope someone will apply this patch,
>>
>>cheers,
>>
>>Steffen Schluff and Kristian Köhler
>>
>>
>>    
>>
>
>
>  
>



Re: [PATCH] XDoclet / JMXDoclet based MBean interface generation added to core module

Posted by Hiram Chirino <hi...@coredevelopers.net>.
+1 for having xdoclet generate the descriptive model XML file.

On Sat, 2003-08-16 at 12:09, James Strachan wrote:
> On Saturday, August 16, 2003, at 04:47  pm, Dain Sundstrom wrote:
> 
> > On Friday, August 15, 2003, at 09:42 PM, Jeremy Boynes wrote:
> >
> >> 2) Do we want to do this for these MBeans as they are likely to
> >>    change to ModelMBeans soon (Dain)?
> >
> > Yes.  We will want a model descriptor file to make the model well -- 
> > more descriptive.  The xml file would include things like parameter, 
> > event and method descriptions.  It will also include persistence and 
> > caching declaration.
> 
> Or we could use doclet tags instead of XML? The benefit of doclet tags 
> is refactoring tools tend to keep them with the methods when you rename 
> & refactor etc.
> 
> James
> -------
> http://radio.weblogs.com/0112098/
-- 
/**************************
  * Hiram Chirino
  * Partner
  * Core Developers Network
  **************************/


AW: [PATCH] XDoclet / JMXDoclet based MBean interface generation added to core module

Posted by Steffen Schluff <sc...@oio.de>.
Hello James, hello all,

we are currently not quite sure what the actual source of the MBeans is
going to be (doclet tags or a XML description file).

If a XML based description is needed it could also be created based on
doclet tags as for example with xdoclet/elbaxmbean. Didn't David mention
somthing like that in a previous posting, too? Besides if we recall
correctly JDK1.5 will most likely include a metadata facility which is more
like the doclet based approach rather than having external XML files for
meta description.

Best regards,

Kristian Kohler and Steffen Schluff

-----Ursprungliche Nachricht-----
Von: James Strachan [mailto:james_strachan@yahoo.co.uk]
Gesendet: Samstag, 16. August 2003 18:10
An: geronimo-dev@incubator.apache.org
Betreff: Re: [PATCH] XDoclet / JMXDoclet based MBean interface
generation added to core module



On Saturday, August 16, 2003, at 04:47  pm, Dain Sundstrom wrote:

> On Friday, August 15, 2003, at 09:42 PM, Jeremy Boynes wrote:
>
>> 2) Do we want to do this for these MBeans as they are likely to
>>    change to ModelMBeans soon (Dain)?
>
> Yes.  We will want a model descriptor file to make the model well --
> more descriptive.  The xml file would include things like parameter,
> event and method descriptions.  It will also include persistence and
> caching declaration.

Or we could use doclet tags instead of XML? The benefit of doclet tags
is refactoring tools tend to keep them with the methods when you rename
& refactor etc.

James
-------
http://radio.weblogs.com/0112098/


Re: [PATCH] XDoclet / JMXDoclet based MBean interface generation added to core module

Posted by James Strachan <ja...@yahoo.co.uk>.
On Saturday, August 16, 2003, at 04:47  pm, Dain Sundstrom wrote:

> On Friday, August 15, 2003, at 09:42 PM, Jeremy Boynes wrote:
>
>> 2) Do we want to do this for these MBeans as they are likely to
>>    change to ModelMBeans soon (Dain)?
>
> Yes.  We will want a model descriptor file to make the model well -- 
> more descriptive.  The xml file would include things like parameter, 
> event and method descriptions.  It will also include persistence and 
> caching declaration.

Or we could use doclet tags instead of XML? The benefit of doclet tags 
is refactoring tools tend to keep them with the methods when you rename 
& refactor etc.

James
-------
http://radio.weblogs.com/0112098/


Re: [PATCH] XDoclet / JMXDoclet based MBean interface generation added to core module

Posted by Dain Sundstrom <da...@coredevelopers.net>.
On Friday, August 15, 2003, at 09:42 PM, Jeremy Boynes wrote:

> 2) Do we want to do this for these MBeans as they are likely to
>    change to ModelMBeans soon (Dain)?

Yes.  We will want a model descriptor file to make the model well -- 
more descriptive.  The xml file would include things like parameter, 
event and method descriptions.  It will also include persistence and 
caching declaration.

-dain


Re: [PATCH] XDoclet / JMXDoclet based MBean interface generation added to core module

Posted by Jason Dillon <ja...@coredevelopers.net>.
XDoclet is a wonderful tool... when it does not break the build system  
due to internal problems ;-)

+1 for XDoclet

--jason


On Saturday, August 16, 2003, at 09:42  AM, Jeremy Boynes wrote:

> A couple of questions first...
>
> 1) Do we want to introduce XDoclet into the build at this time?
>
> 2) Do we want to do this for these MBeans as they are likely to
>    change to ModelMBeans soon (Dain)?
>
> --
> Jeremy
>
>> -----Original Message-----
>> From: Kristian Köhler [mailto:Kristian.Koehler@gmx.de]
>> Sent: Friday, August 15, 2003 2:26 PM
>> To: geronimo-dev@incubator.apache.org
>> Subject: [PATCH] XDoclet / JMXDoclet based MBean interface generation
>> added to core module
>>
>>
>> Hi,
>>
>> we extended the build process of the core module by including XDoclet  
>> /
>> JMXDoclet based MBean interface generation. Using JMXDoclet all MBean
>> interfaces can be created automatically based on meta information in  
>> the
>> implementing classes hence avoiding tedious copy/paste duplication.
>>
>> To do so we included the xdoclet plugin for maven as outlined in the
>> xdoclet documentation (see
>> http://xdoclet.sourceforge.net/maven-plugin.html), adjusted the build
>> files for the core module accordingly, added meta information to all
>> mbean implementors and removed the respective interfaces (which are  
>> now
>> created when building via maven).
>>
>> Here is how to make use of the functionality for a simple example  
>> (patch
>> includes all changes of course :-)):
>>
>> /**
>>   * @jmx.mbean
>>  */
>> public class ClassSpace extends URLClassLoader implements
>> ClassSpaceMBean {
>>     public ClassSpace(URL[] urls) {
>>         super(urls);
>>     }
>>
>>     /**
>>      * @jmx.managed-operation
>>      * @jmx.managed-parameter type="List" name="urls"
>>      */
>>     public void addURLs(List urls) {
>>         for (Iterator i = urls.iterator(); i.hasNext();) {
>>             URL url = (URL) i.next();
>>             addURL(url);
>>         }
>>     }
>> }
>>
>> Besides applying the patch, the following classes have to be removed:
>>
>> org.apache.geronimo.deployment.DeploymentControllerMBean.java
>> org.apache.geronimo.deployment.DeploymentInfoMBean.java
>> org.apache.geronimo.deployment.loader.ClassSpaceMBean.java
>> org.apache.geronimo.deployment.repository.ComponentRepositoryMBean.jav 
>> a
>> org.apache.geronimo.deployment.scanner.DeploymentScannerMBean.java
>> org.apache.geronimo.deployment.service.ServiceDeploymentMBean.java
>> org.apache.geronimo.deployment.service.ServiceDeploymentPlannerMBean.j 
>> ava
>> org.apache.geronimo.jmx.RelationshipMBean.java
>>
>> We hope someone will apply this patch,
>>
>> cheers,
>>
>> Steffen Schluff and Kristian Köhler
>>
>>
>


RE: [PATCH] XDoclet / JMXDoclet based MBean interface generation added to core module

Posted by Jeremy Boynes <je...@coredevelopers.net>.
A couple of questions first...

1) Do we want to introduce XDoclet into the build at this time?

2) Do we want to do this for these MBeans as they are likely to
   change to ModelMBeans soon (Dain)?

--
Jeremy

> -----Original Message-----
> From: Kristian Köhler [mailto:Kristian.Koehler@gmx.de]
> Sent: Friday, August 15, 2003 2:26 PM
> To: geronimo-dev@incubator.apache.org
> Subject: [PATCH] XDoclet / JMXDoclet based MBean interface generation
> added to core module
>
>
> Hi,
>
> we extended the build process of the core module by including XDoclet /
> JMXDoclet based MBean interface generation. Using JMXDoclet all MBean
> interfaces can be created automatically based on meta information in the
> implementing classes hence avoiding tedious copy/paste duplication.
>
> To do so we included the xdoclet plugin for maven as outlined in the
> xdoclet documentation (see
> http://xdoclet.sourceforge.net/maven-plugin.html), adjusted the build
> files for the core module accordingly, added meta information to all
> mbean implementors and removed the respective interfaces (which are now
> created when building via maven).
>
> Here is how to make use of the functionality for a simple example (patch
> includes all changes of course :-)):
>
> /**
>   * @jmx.mbean
>  */
> public class ClassSpace extends URLClassLoader implements
> ClassSpaceMBean {
>     public ClassSpace(URL[] urls) {
>         super(urls);
>     }
>
>     /**
>      * @jmx.managed-operation
>      * @jmx.managed-parameter type="List" name="urls"
>      */
>     public void addURLs(List urls) {
>         for (Iterator i = urls.iterator(); i.hasNext();) {
>             URL url = (URL) i.next();
>             addURL(url);
>         }
>     }
> }
>
> Besides applying the patch, the following classes have to be removed:
>
> org.apache.geronimo.deployment.DeploymentControllerMBean.java
> org.apache.geronimo.deployment.DeploymentInfoMBean.java
> org.apache.geronimo.deployment.loader.ClassSpaceMBean.java
> org.apache.geronimo.deployment.repository.ComponentRepositoryMBean.java
> org.apache.geronimo.deployment.scanner.DeploymentScannerMBean.java
> org.apache.geronimo.deployment.service.ServiceDeploymentMBean.java
> org.apache.geronimo.deployment.service.ServiceDeploymentPlannerMBean.java
> org.apache.geronimo.jmx.RelationshipMBean.java
>
> We hope someone will apply this patch,
>
> cheers,
>
> Steffen Schluff and Kristian Köhler
>
>