KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > jboss > jmx > JBossXmlServiceTemplateSubTask


1 /*
2  * Copyright (c) 2001, 2002 The XDoclet team
3  * All rights reserved.
4  */

5 package xdoclet.modules.jboss.jmx;
6
7 import xdoclet.XDocletException;
8
9 import xdoclet.XmlSubTask;
10
11 /**
12  * Generates a {servicefile}-service.xml file for JBoss mbean configuration. This can help you see what you can set in
13  * an mbean, you can just fill in your values and deploy. Currently there is a limitation that only managed attributes
14  * with getters show up in the results, however there is a comment for those with only a setter. It treats read-only
15  * managed attributes as if they can be written.
16  *
17  * @author <a HREF="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
18  * @created March 3, 2002
19  * @ant.element display-name="JBoss XML Service" name="jbossxmlservicetemplate"
20  * parent="xdoclet.modules.jmx.JMXDocletTask"
21  * @version $Revision: 1.9 $
22  * @xdoclet.merge-file file="jboss-service.ent" relates-to="{servicefile}-service.xml" description="An XML unparsed
23  * entity containing jboss deployment descriptions for mbeans you wish to include in the {servicefile}-service.xml
24  * which aren't processed by XDoclet. It can also include classpath and global depends elements. servicefile is
25  * specified in the ant subtask"
26  */

27 public class JBossXmlServiceTemplateSubTask extends XmlSubTask
28 {
29     private final static String JavaDoc DD_FILE_NAME = "-service.xml";
30
31     private static String JavaDoc DEFAULT_TEMPLATE_FILE = "resources/jboss-service-template.xdt";
32
33     private String JavaDoc servicefile;
34
35     /**
36      * Describe what the JBossXmlServiceTemplateSubTask constructor does
37      */

38     public JBossXmlServiceTemplateSubTask()
39     {
40         setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
41         setDestinationFile(DD_FILE_NAME);
42         setHavingClassTag("jmx:mbean");
43     }
44
45     /**
46      * Get the Servicefile value.
47      *
48      * @return the Servicefile value.
49      */

50     public String JavaDoc getServicefile()
51     {
52         return servicefile;
53     }
54
55     /**
56      * Set the Servicefile value.
57      *
58      * @param servicefile
59      */

60     public void setServicefile(String JavaDoc servicefile)
61     {
62         this.servicefile = servicefile;
63     }
64
65
66     public void execute() throws XDocletException
67     {
68         setDestinationFile(servicefile + "-service.xml");
69         setHavingClassTag("jmx:mbean");
70         super.execute();
71     }
72 }
73
Popular Tags