KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > engine > IPageLoader


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.engine;
16
17 import org.apache.hivemind.Location;
18 import org.apache.tapestry.IComponent;
19 import org.apache.tapestry.IEngine;
20 import org.apache.tapestry.INamespace;
21 import org.apache.tapestry.IPage;
22 import org.apache.tapestry.IRequestCycle;
23 import org.apache.tapestry.ITemplateComponent;
24 import org.apache.tapestry.spec.IComponentSpecification;
25
26 /**
27  * Interface exposed to components as they are loaded by the page loader.
28  *
29  * @see IComponent#finishLoad(IRequestCycle, IPageLoader,
30  * org.apache.tapestry.spec.IComponentSpecification)
31  * @author Howard Lewis Ship
32  */

33
34 public interface IPageLoader
35 {
36     /**
37      * Invoked to create an implicit component (one which is defined in the containing component's
38      * template, rather that in the containing component's specification).
39      *
40      * @see org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl
41      * @since 3.0
42      */

43
44     public IComponent createImplicitComponent(IRequestCycle cycle, IComponent container, String JavaDoc componentId,
45             String JavaDoc componentType, Location location);
46
47     /**
48      * Invoked by the {@link IPageSource}to load a specific page. This method is not reentrant. The
49      * page is immediately attached to the {@link IEngine engine}.
50      *
51      * @param name
52      * the simple (unqualified) name of the page to load
53      * @param namespace
54      * from which the page is to be loaded (used when resolving components embedded by
55      * the page)
56      * @param cycle
57      * the request cycle the page is initially loaded for (this is used to define the
58      * locale of the new page, and provide access to the corect specification source,
59      * etc.).
60      * @param specification
61      * the specification for the page
62      */

63
64     public IPage loadPage(String JavaDoc name, INamespace namespace, IRequestCycle cycle, IComponentSpecification specification);
65
66     /**
67      * Invoked by a component (from within its
68      * {@link IComponent#finishLoad(IRequestCycle, IPageLoader, IComponentSpecification)}method) to
69      * load the template for the component. This will result in new components being created, and
70      * the "outers" of the component being updated.
71      *
72      * @see ITemplateComponent
73      * @since 4.0
74      */

75     public void loadTemplateForComponent(IRequestCycle cycle, ITemplateComponent component);
76 }
Popular Tags