001    // Copyright 2004, 2005 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.tapestry.engine;
016    
017    import org.apache.hivemind.Resource;
018    import org.apache.tapestry.INamespace;
019    import org.apache.tapestry.spec.IComponentSpecification;
020    import org.apache.tapestry.spec.ILibrarySpecification;
021    
022    /**
023     * Defines access to component specifications.
024     * 
025     * @see IComponentSpecification
026     * @author Howard Lewis Ship
027     */
028    
029    public interface ISpecificationSource
030    {
031        /**
032         * Retrieves a component specification, parsing it as necessary.
033         * 
034         * @param specificationLocation
035         *            the location where the specification may be read from.
036         * @throws org.apache.hivemind.ApplicationRuntimeException
037         *             if the specification doesn't exist, is unreadable or invalid.
038         * @since 2.2
039         */
040    
041        public IComponentSpecification getComponentSpecification(Resource specificationLocation);
042    
043        /**
044         * Retrieves a page specification, parsing it as necessary.
045         * 
046         * @param specificationLocation
047         *            the location where the specification may be read from.
048         * @throws org.apache.hivemind.ApplicationRuntimeException
049         *             if the specification doesn't exist, is unreadable or invalid.
050         * @since 2.2
051         */
052    
053        public IComponentSpecification getPageSpecification(Resource specificationLocation);
054    
055        /**
056         * Returns a {@link org.apache.tapestry.spec.LibrarySpecification} with the given path.
057         * 
058         * @param specificationLocation
059         *            the resource path of the specification to return
060         * @throws org.apache.hivemind.ApplicationRuntimeException
061         *             if the specification cannot be read
062         * @since 2.2
063         */
064    
065        public ILibrarySpecification getLibrarySpecification(Resource specificationLocation);
066    
067        /**
068         * Returns the {@link INamespace} for the application.
069         * 
070         * @since 2.2
071         */
072    
073        public INamespace getApplicationNamespace();
074    
075        /**
076         * Returns the {@link INamespace} for the framework itself.
077         * 
078         * @since 2.2
079         */
080    
081        public INamespace getFrameworkNamespace();
082    }