001    /**
002     *
003     * Copyright 2003-2004 The Apache Software Foundation
004     *
005     *  Licensed under the Apache License, Version 2.0 (the "License");
006     *  you may not use this file except in compliance with the License.
007     *  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     *  Unless required by applicable law or agreed to in writing, software
012     *  distributed under the License is distributed on an "AS IS" BASIS,
013     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     *  See the License for the specific language governing permissions and
015     *  limitations under the License.
016     */
017    
018    //
019    // This source code implements specifications defined by the Java
020    // Community Process. In order to remain compliant with the specification
021    // DO NOT add / change / or delete method signatures!
022    //
023    
024    package javax.enterprise.deploy.model;
025    
026    import javax.enterprise.deploy.shared.ModuleType;
027    
028    /**
029     * J2eeApplicationObject is an interface that represents a J2EE application (EAR);
030     * it maintains a DeployableObject for each module in the archive.
031     *
032     * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
033     */
034    public interface J2eeApplicationObject extends DeployableObject {
035        /**
036         * Return the DeployableObject of the specified URI designator.
037         *
038         * @param uri Describes where to get the module from.
039         *
040         * @return the DeployableObject describing the j2ee module at this uri
041         *         or <code>null</code> if there is not match.
042         */
043        public DeployableObject getDeployableObject(String uri);
044    
045        /**
046         * Return the all DeployableObjects of the specified type.
047         *
048         * @param type The type of module to return.
049         *
050         * @return the list of DeployableObjects describing the j2ee modules of
051         *         this type or <code>null</code> if there are no matches.
052         */
053        public DeployableObject[] getDeployableObjects(ModuleType type);
054    
055        /**
056         * Return the all DeployableObjects in this application.
057         *
058         * @return the DeployableObject instances describing the j2ee modules in
059         *         this application or <code>null</code> if there are none available.
060         */
061        public DeployableObject[] getDeployableObjects();
062    
063        /**
064         * Return the list of URIs of the designated module type.
065         *
066         * @param type The type of module to return.
067         *
068         * @return the Uris of the contained modules or <code>null</code> if there
069         *         are no matches.
070         */
071        public String[] getModuleUris(ModuleType type);
072    
073        /**
074         * Return the list of URIs for all modules in the application.
075         *
076         * @return the Uris of the contained modules or <code>null</code> if
077         *         the application is completely empty.
078         */
079        public String[] getModuleUris();
080    
081        /**
082         * Return a list of DDBean instances based upon an XPath; all deployment
083         * descriptors of the specified type are searched.
084         *
085         * @param type  The type of deployment descriptor to query.
086         * @param xpath An XPath string referring to a location in the deployment descriptor
087         *
088         * @return The list of DDBeans or <code>null</code> if there are no matches.
089         */
090        public DDBean[] getChildBean(ModuleType type, String xpath);
091    
092        /**
093         * Return the text value from the XPath; search only the deployment descriptors
094         * of the specified type.
095         *
096         * @param type  The type of deployment descriptor to query.
097         * @param xpath The xpath to query for.
098         *
099         * @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    }