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 found by the normal
023 * means. This allows hooks to support specifications from unusual locations, or generated on the
024 * 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 * Invoked by {@link PageSpecificationResolver} to find the indicated page specification.
036 * Returns the specification, or null. The specification, if returned, <em>will be cached</em>
037 * (this represents a change from release 3.0 to release 4.0).
038 *
039 * @param cycle
040 * used to gain access to framework and Servlet API objects
041 * @param namespace
042 * the namespace containing the page
043 * @param simplePageName
044 * the name of the page (without any namespace prefix)
045 */
046
047 public IComponentSpecification findPageSpecification(IRequestCycle cycle, INamespace namespace,
048 String simplePageName);
049
050 /**
051 * Invoked by {@link PageSpecificationResolver} to find the indicated component specification.
052 * Returns the specification, or null. The specification <em>will be cached</em> (this
053 * represents a change from release 3.0 to release 4.0).
054 *
055 * @param cycle
056 * used to gain access to framework and Servlet API objects
057 * @param namespace
058 * the namespace containing the component
059 * @param type
060 * the component type (without any namespace prefix)
061 */
062
063 public IComponentSpecification findComponentSpecification(IRequestCycle cycle,
064 INamespace namespace, String type);
065 }