1 /**
2 *
3 * Copyright 2003-2004 The Apache Software Foundation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
19
20
21
22
23
24 package javax.enterprise.deploy.model;
25
26 import javax.enterprise.deploy.shared.ModuleType;
27
28 /**
29 * J2eeApplicationObject is an interface that represents a J2EE application (EAR);
30 * it maintains a DeployableObject for each module in the archive.
31 *
32 * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
33 */
34 public interface J2eeApplicationObject extends DeployableObject {
35 /**
36 * Return the DeployableObject of the specified URI designator.
37 *
38 * @param uri Describes where to get the module from.
39 *
40 * @return the DeployableObject describing the j2ee module at this uri
41 * or <code>null</code> if there is not match.
42 */
43 public DeployableObject getDeployableObject(String uri);
44
45 /**
46 * Return the all DeployableObjects of the specified type.
47 *
48 * @param type The type of module to return.
49 *
50 * @return the list of DeployableObjects describing the j2ee modules of
51 * this type or <code>null</code> if there are no matches.
52 */
53 public DeployableObject[] getDeployableObjects(ModuleType type);
54
55 /**
56 * Return the all DeployableObjects in this application.
57 *
58 * @return the DeployableObject instances describing the j2ee modules in
59 * this application or <code>null</code> if there are none available.
60 */
61 public DeployableObject[] getDeployableObjects();
62
63 /**
64 * Return the list of URIs of the designated module type.
65 *
66 * @param type The type of module to return.
67 *
68 * @return the Uris of the contained modules or <code>null</code> if there
69 * are no matches.
70 */
71 public String[] getModuleUris(ModuleType type);
72
73 /**
74 * Return the list of URIs for all modules in the application.
75 *
76 * @return the Uris of the contained modules or <code>null</code> if
77 * the application is completely empty.
78 */
79 public String[] getModuleUris();
80
81 /**
82 * Return a list of DDBean instances based upon an XPath; all deployment
83 * descriptors of the specified type are searched.
84 *
85 * @param type The type of deployment descriptor to query.
86 * @param xpath An XPath string referring to a location in the deployment descriptor
87 *
88 * @return The list of DDBeans or <code>null</code> if there are no matches.
89 */
90 public DDBean[] getChildBean(ModuleType type, String xpath);
91
92 /**
93 * Return the text value from the XPath; search only the deployment descriptors
94 * of the specified type.
95 *
96 * @param type The type of deployment descriptor to query.
97 * @param xpath The xpath to query for.
98 *
99 * @return The text values of this xpath or <code>null</code> if there are no matches.
100 */
101 public String[] getText(ModuleType type, String xpath);
102
103 /**
104 * Register a listener for changes in XPath that are related to this deployableObject.
105 *
106 * @param type The type of deployment descriptor to query.
107 * @param xpath The xpath to listen for.
108 * @param xpl The listener.
109 */
110 public void addXpathListener(ModuleType type, String xpath, XpathListener xpl);
111
112 /**
113 * Unregister the listener for an XPath.
114 * @param type The type of deployment descriptor to query.
115 * @param xpath The xpath to listen for.
116 * @param xpl The listener.
117 */
118 public void removeXpathListener(ModuleType type, String xpath, XpathListener xpl);
119 }