KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > enterprise > deploy > model > DeployableObject


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package javax.enterprise.deploy.model;
25
26 import javax.enterprise.deploy.shared.ModuleType JavaDoc;
27 import java.util.Enumeration JavaDoc;
28 import java.io.InputStream JavaDoc;
29 import java.io.IOException JavaDoc;
30
31 /**
32  * The DeployableObject interface is an abstract representation
33  * of a J2EE deployable module (JAR, WAR, RAR, EAR). A
34  * DeployableObject provides access to the module's deployment
35  * descriptor and class files.
36  *
37  * @author gfink
38  * @version 0.1
39  */

40 public interface DeployableObject
41 {
42
43    /**
44     * Return the ModuleType of deployment descriptor (i.e., EAR,
45     * JAR, WAR, RAR) this deployable object represents.
46     * Values are found in DeploymentManager.
47     *
48     * @return The ModuleType of deployable object
49     */

50    public ModuleType JavaDoc getType();
51    
52    /**
53     * Return the top level standard bean representing
54     * the root of the deployment descriptor.
55     *
56     * @return A standard bean representing the deployment
57     * descriptor.
58     */

59     public DDBeanRoot JavaDoc getDDBeanRoot();
60
61     /**
62      * Return an array of standard beans representing the
63      * XML content returned based upon the XPath.
64      *
65      * @param xpath An XPath string identifying the data to
66      * be extracted from the deployment descriptor.
67      * @return a array of DDBeans or 'null' if no matching data found.
68      *
69      */

70    public DDBean JavaDoc[] getChildBean(String JavaDoc xpath);
71    
72    /**
73     * Return the XML content associated with the XPath
74     * from a deployment descriptor.
75     *
76     * @param xpath An xpath string referring to a location in the
77     * deployment descriptor
78     * @return a list XML content or 'null' if no matching data found.
79     */

80    public String JavaDoc[] getText(String JavaDoc xpath);
81    
82     /**
83      * Retrieve the specified class from this deployable module.
84      * <p>
85      * One use: to get all finder methods from an EJB
86      *
87      * If the tool is attempting to package an module
88      * and retrieve a class from the package, the class
89      * request may fail. The class may not yet be
90      * available. The tool should respect the manifest
91      * cross-path entries.
92      *
93      * @param className Class to retrieve.
94      * @return Class representation of the class
95      */

96     public Class JavaDoc getClassFromScope(String JavaDoc className);
97
98    /**
99     * Returns the DTD version number given in the XML
100     * DOCTYPE text provided in every standard J2EE module's
101     * deployment descriptor file.
102     * @return a string containing the DTD version number
103     *
104     * <PRE>
105     * A module's deployment descriptor file always contains
106     * a document type identifier, DOCTYPE. The DOCTYPE statement
107     * contains the module DTD version number in the label of the
108     * statement.
109     *
110     * The format of the DOCTYPE statement is:
111     *<ul>
112     * &lt!DOCTYPE root_element PUBLIC
113     * "-//organization//label//language" "location"&gt
114     *</ul>
115     *
116     * root_element - is the name of the root document in the DTD.
117     * organization - is the name of the organization responsible
118     * for the creation and maintenance of the DTD
119     * being referenced.
120     * label - is a unique descriptive name for the public text being
121     * referenced.
122     * language - is the ISO 639 language id representing the natural
123     * language encoding of th DTD.
124     * location - is the URL of the DTD.
125     *
126     * An example J2EE deployment descriptor DOCTYPE statement is:
127     *<ul>
128     * &lt!DOCTYPE application-client PUBLIC
129     * "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN"
130     * "http://java.sun.com/dtd/application-client_1_3.dtd"&gt
131     *</ul>
132     * In this example the label is, "DTD J2EE Application Client 1.3",
133     * and the DTD version number is 1.3. A call to getModuleDTDVersion
134     * would return a string containing, "1.3".
135     * </PRE>
136     *
137     * This method is being deprecated. With the addition of multiple
138     * deployment descritors in components for J2EE 1.4 this method is
139     * being replaced by DDBeanRoot.getDDBeanRootVersion.
140     *
141     * @deprecated As of version 1.1 replaced by
142     * DDBeanRoot.getDDBeanRootVersion()
143     */

144    public String JavaDoc getModuleDTDVersion();
145
146     /**
147      * Returns a DDBeanRoot object for the XML instance document named.
148      * This method should be used to return DDBeanRoot objects for non
149      * deployment descriptor XML instance documents such as WSDL files.
150      *
151      * @return a DDBeanRoot object for the XML data.
152      * @throws java.io.FileNotFoundException, if the named file can not
153      * be found
154      * @throws javax.enterprise.deploy.model.exceptions.DDBeanCreateException
155      * if an error is encountered creating the DDBeanRoot object.
156      */

157     public DDBeanRoot JavaDoc getDDBeanRoot(String JavaDoc filename) throws
158          java.io.FileNotFoundException JavaDoc,
159          javax.enterprise.deploy.model.exceptions.DDBeanCreateException;
160
161     /**
162      * Returns an enumeration of the module file entries. All elements
163      * in the enumeration are of type String. Each String represents a
164      * file name relative to the root of the module.
165      *
166      * @return an enumeration of the archive file entries.
167      */

168     public Enumeration JavaDoc entries();
169
170     /**
171      * Returns the InputStream for the given entry name
172      * The file name must be relative to the root of the module.
173      *
174      * @param name the file name relative to the root of the module.
175      *
176      * @return the InputStream for the given entry name or null if not found.
177      */

178     public InputStream JavaDoc getEntry(String JavaDoc name);
179  }
180
181
Popular Tags