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 /**
033 * Retrieves a component specification, parsing it as necessary.
034 *
035 * @param specificationLocation
036 * the location where the specification may be read from.
037 * @throws org.apache.hivemind.ApplicationRuntimeException
038 * if the specification doesn't exist, is unreadable or invalid.
039 * @since 2.2
040 */
041
042 IComponentSpecification getComponentSpecification(
043 Resource specificationLocation);
044
045 /**
046 * Retrieves a page specification, parsing it as necessary.
047 *
048 * @param specificationLocation
049 * the location where the specification may be read from.
050 * @throws org.apache.hivemind.ApplicationRuntimeException
051 * if the specification doesn't exist, is unreadable or invalid.
052 * @since 2.2
053 */
054
055 IComponentSpecification getPageSpecification(
056 Resource specificationLocation);
057
058 /**
059 * Returns a {@link org.apache.tapestry.spec.LibrarySpecification} with the
060 * given path.
061 *
062 * @param specificationLocation
063 * the resource path of the specification to return
064 * @throws org.apache.hivemind.ApplicationRuntimeException
065 * if the specification cannot be read
066 * @since 2.2
067 */
068
069 ILibrarySpecification getLibrarySpecification(
070 Resource specificationLocation);
071
072 /**
073 * Returns the {@link INamespace} for the application.
074 *
075 * @since 2.2
076 */
077
078 INamespace getApplicationNamespace();
079
080 /**
081 * Returns the {@link INamespace} for the framework itself.
082 *
083 * @since 2.2
084 */
085
086 INamespace getFrameworkNamespace();
087 }