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.resolver;
016    
017    import org.apache.tapestry.INamespace;
018    import org.apache.tapestry.IRequestCycle;
019    import org.apache.tapestry.spec.IComponentSpecification;
020    
021    /**
022     * Delegate interface used when a page or component specification can not be
023     * found by the normal means. This allows hooks to support specifications from
024     * unusual locations, or generated on the fly.
025     * <p>
026     * The delegate must be coded in a threadsafe manner.
027     * 
028     * @author Howard Lewis Ship
029     * @since 3.0
030     */
031    
032    public interface ISpecificationResolverDelegate
033    {
034    
035        /**
036         * Invoked by {@link PageSpecificationResolver} to find the indicated page
037         * specification. Returns the specification, or null. The specification, if
038         * returned, <em>will be cached</em> (this represents a change from
039         * release 3.0 to release 4.0).
040         * 
041         * @param cycle
042         *            used to gain access to framework and Servlet API objects
043         * @param namespace
044         *            the namespace containing the page
045         * @param simplePageName
046         *            the name of the page (without any namespace prefix)
047         */
048    
049        IComponentSpecification findPageSpecification(IRequestCycle cycle,
050                INamespace namespace, String simplePageName);
051    
052        /**
053         * Invoked by {@link PageSpecificationResolver} to find the indicated
054         * component specification. Returns the specification, or null. The
055         * specification <em>will be cached</em> (this represents a change from
056         * release 3.0 to release 4.0).
057         * 
058         * @param cycle
059         *            used to gain access to framework and Servlet API objects
060         * @param namespace
061         *            the namespace containing the component
062         * @param type
063         *            the component type (without any namespace prefix)
064         */
065    
066        IComponentSpecification findComponentSpecification(
067                IRequestCycle cycle, INamespace namespace, String type);
068    }