KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > orion > ejb > OrionSubTask


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

5 package xdoclet.modules.orion.ejb;
6
7 import xdoclet.modules.ejb.dd.AbstractEjbDeploymentDescriptorSubTask;
8
9 /**
10  * Generates Orion's orion-ejb-jar.xml.
11  *
12  * @author Ara Abrahamian (ara_e_w@yahoo.com)
13  * @created May 15, 2001
14  * @ant.element display-name="Orion" name="orion" parent="xdoclet.modules.ejb.EjbDocletTask"
15  * @version $Revision: 1.9 $
16  * @xdoclet.merge-file file="orion-{0}.xml" relates-to="orion-ejb-jar.xml" description="An XML document containing the
17  * session-deployment, entity-deployment or message-driven-deployment element for a bean, instead of generating it
18  * from tags."
19  * @xdoclet.merge-file file="orion-{0}-attributes.xml" relates-to="orion-ejb-jar.xml" description="A text file
20  * containing the attributes for a bean's session-deployment, entity-deployment or message-driven-deployment
21  * element, instead of specifying them with orion.bean tag parameters."
22  * @xdoclet.merge-file file="orion-{0}-settings.xml" relates-to="orion-ejb-jar.xml" description="An XML unparsed
23  * entity containing the (env-entry-mapping*, ejb-ref-mapping*) elements for a bean."
24  * @xdoclet.merge-file file="orion-assembly-descriptor.xml" relates-to="orion-ejb-jar.xml" description="An XML
25  * document containing the assembly-descriptor element for orion-ejb-jar.xml."
26  */

27 public class OrionSubTask extends AbstractEjbDeploymentDescriptorSubTask
28 {
29     private final static String JavaDoc ORION_DD_FILE_NAME = "orion-ejb-jar.xml";
30
31     private final static String JavaDoc ORION_DD_PUBLICID = "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN";
32
33     private final static String JavaDoc ORION_DD_SYSTEMID = "http://www.orionserver.com/dtds/orion-ejb-jar.dtd";
34
35     private final static String JavaDoc ORION_DTD_FILE_NAME = "resources/orion-ejb-jar.dtd";
36
37     private static String JavaDoc DEFAULT_TEMPLATE_FILE = "resources/orion.xdt";
38
39     private String JavaDoc version = OrionVersionTypes.VERSION_1_6_0;
40
41     /**
42      * Describe what the OrionSubTask constructor does
43      */

44     public OrionSubTask()
45     {
46         setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
47         setDestinationFile(ORION_DD_FILE_NAME);
48
49         setPublicId(ORION_DD_PUBLICID);
50         setSystemId(ORION_DD_SYSTEMID);
51         setDtdURL(getClass().getResource(ORION_DTD_FILE_NAME));
52     }
53
54     /**
55      * Gets the DeploymentVersion attribute of the OrionSubTask object
56      *
57      * @return The DeploymentVersion value
58      */

59     public String JavaDoc getVersion()
60     {
61         return this.version;
62     }
63
64     /**
65      * Sets the DeploymentVersion attribute of the OrionSubTask object
66      *
67      * @param version The new DeploymentVersion value
68      */

69     public void setVersion(OrionVersionTypes version)
70     {
71         this.version = version.getValue();
72     }
73
74     /**
75      * @author Aslak Hellesøy
76      * @created November 22, 2001
77      */

78     public static class OrionVersionTypes extends org.apache.tools.ant.types.EnumeratedAttribute
79     {
80         public final static String JavaDoc VERSION_1_5_0 = "1.5.0";
81         public final static String JavaDoc VERSION_1_5_1 = "1.5.1";
82         public final static String JavaDoc VERSION_1_5_2 = "1.5.2";
83         public final static String JavaDoc VERSION_1_5_3 = "1.5.3";
84         public final static String JavaDoc VERSION_1_5_4 = "1.5.4";
85         public final static String JavaDoc VERSION_1_6_0 = "1.6.0";
86         public final static String JavaDoc VERSION_2_0 = "2.0";
87
88         /**
89          * Gets the Values attribute of the OrionVersionTypes object
90          *
91          * @return The Values value
92          */

93         public String JavaDoc[] getValues()
94         {
95             return (new String JavaDoc[]{VERSION_1_5_0, VERSION_1_5_1, VERSION_1_5_2, VERSION_1_5_3, VERSION_1_5_4, VERSION_1_6_0, VERSION_2_0});
96         }
97     }
98 }
99
Popular Tags