Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
IPageLoader |
|
| 1.0;1 |
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 | /** |
|
38 | * Invoked to create an implicit component (one which is defined in the |
|
39 | * containing component's template, rather that in the containing |
|
40 | * component's specification). |
|
41 | * |
|
42 | * @see org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl |
|
43 | * @since 3.0 |
|
44 | */ |
|
45 | ||
46 | IComponent createImplicitComponent(IRequestCycle cycle, |
|
47 | IComponent container, String componentId, String componentType, |
|
48 | Location location); |
|
49 | ||
50 | /** |
|
51 | * Invoked by the {@link IPageSource}to load a specific page. This method |
|
52 | * is not reentrant. The page is immediately attached to the |
|
53 | * {@link IEngine engine}. |
|
54 | * |
|
55 | * @param name |
|
56 | * the simple (unqualified) name of the page to load |
|
57 | * @param namespace |
|
58 | * from which the page is to be loaded (used when resolving |
|
59 | * components embedded by the page) |
|
60 | * @param cycle |
|
61 | * the request cycle the page is initially loaded for (this is |
|
62 | * used to define the locale of the new page, and provide access |
|
63 | * to the corect specification source, etc.). |
|
64 | * @param specification |
|
65 | * the specification for the page |
|
66 | */ |
|
67 | ||
68 | IPage loadPage(String name, INamespace namespace, |
|
69 | IRequestCycle cycle, IComponentSpecification specification); |
|
70 | ||
71 | /** |
|
72 | * Invoked by a component (from within its |
|
73 | * {@link IComponent#finishLoad(IRequestCycle, IPageLoader, IComponentSpecification)}method) |
|
74 | * to load the template for the component. This will result in new |
|
75 | * components being created, and the "outers" of the component being |
|
76 | * updated. |
|
77 | * |
|
78 | * @see ITemplateComponent |
|
79 | * @since 4.0 |
|
80 | */ |
|
81 | void loadTemplateForComponent(IRequestCycle cycle, |
|
82 | ITemplateComponent component); |
|
83 | } |