001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    //
021    // This source code implements specifications defined by the Java
022    // Community Process. In order to remain compliant with the specification
023    // DO NOT add / change / or delete method signatures!
024    //
025    
026    package javax.enterprise.deploy.model;
027    
028    import javax.enterprise.deploy.shared.ModuleType;
029    
030    /**
031     * J2eeApplicationObject is an interface that represents a J2EE application (EAR);
032     * it maintains a DeployableObject for each module in the archive.
033     *
034     * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25. Okt 2006) $
035     */
036    public interface J2eeApplicationObject extends DeployableObject {
037        /**
038         * Return the DeployableObject of the specified URI designator.
039         *
040         * @param uri Describes where to get the module from.
041         *
042         * @return the DeployableObject describing the j2ee module at this uri
043         *         or <code>null</code> if there is not match.
044         */
045        public DeployableObject getDeployableObject(String uri);
046    
047        /**
048         * Return the all DeployableObjects of the specified type.
049         *
050         * @param type The type of module to return.
051         *
052         * @return the list of DeployableObjects describing the j2ee modules of
053         *         this type or <code>null</code> if there are no matches.
054         */
055        public DeployableObject[] getDeployableObjects(ModuleType type);
056    
057        /**
058         * Return the all DeployableObjects in this application.
059         *
060         * @return the DeployableObject instances describing the j2ee modules in
061         *         this application or <code>null</code> if there are none available.
062         */
063        public DeployableObject[] getDeployableObjects();
064    
065        /**
066         * Return the list of URIs of the designated module type.
067         *
068         * @param type The type of module to return.
069         *
070         * @return the Uris of the contained modules or <code>null</code> if there
071         *         are no matches.
072         */
073        public String[] getModuleUris(ModuleType type);
074    
075        /**
076         * Return the list of URIs for all modules in the application.
077         *
078         * @return the Uris of the contained modules or <code>null</code> if
079         *         the application is completely empty.
080         */
081        public String[] getModuleUris();
082    
083        /**
084         * Return a list of DDBean instances based upon an XPath; all deployment
085         * descriptors of the specified type are searched.
086         *
087         * @param type  The type of deployment descriptor to query.
088         * @param xpath An XPath string referring to a location in the deployment descriptor
089         *
090         * @return The list of DDBeans or <code>null</code> if there are no matches.
091         */
092        public DDBean[] getChildBean(ModuleType type, String xpath);
093    
094        /**
095         * Return the text value from the XPath; search only the deployment descriptors
096         * of the specified type.
097         *
098         * @param type  The type of deployment descriptor to query.
099         * @param xpath The xpath to query for.
100         *
101         * @return The text values of this xpath or <code>null</code> if there are no matches.
102         */
103        public String[] getText(ModuleType type, String xpath);
104    
105        /**
106         * Register a listener for changes in XPath that are related to this deployableObject.
107         *
108         * @param type  The type of deployment descriptor to query.
109         * @param xpath The xpath to listen for.
110         * @param xpl   The listener.
111         */
112        public void addXpathListener(ModuleType type, String xpath, XpathListener xpl);
113    
114        /**
115         * Unregister the listener for an XPath.
116         * @param type  The type of deployment descriptor to query.
117         * @param xpath The xpath to listen for.
118         * @param xpl   The listener.
119         */
120        public void removeXpathListener(ModuleType type, String xpath, XpathListener xpl);
121    }