Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
IPageSource |
|
| 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.ClassResolver; | |
18 | import org.apache.tapestry.IPage; | |
19 | import org.apache.tapestry.IRequestCycle; | |
20 | ||
21 | /** | |
22 | * Abstracts the process of loading pages from thier specifications as well as pooling of pages once | |
23 | * loaded. | |
24 | * <p> | |
25 | * If the required page is not available, a page source may use an instance of {@link IPageLoader} | |
26 | * to actually load the page (and all of its nested components). | |
27 | * | |
28 | * @author Howard Lewis Ship | |
29 | */ | |
30 | ||
31 | public interface IPageSource | |
32 | { | |
33 | /** | |
34 | * Gets a given page for the engine. This may involve using a previously loaded page from a pool | |
35 | * of available pages, or the page may be loaded as needed. | |
36 | * | |
37 | * @param cycle | |
38 | * the current request cycle | |
39 | * @param pageName | |
40 | * the name of the page. May be qualified with a library id prefix, which may even be | |
41 | * nested. Unqualified names are searched for extensively in the application | |
42 | * namespace, and then in the framework namespace. | |
43 | * @return The loaded page. | |
44 | * | |
45 | * @throws org.apache.tapestry.PageNotFoundException | |
46 | * if pageName can't be resolved to a page specification (from which a page instance | |
47 | * can be generated). | |
48 | * @see org.apache.tapestry.resolver.PageSpecificationResolver#resolve(IRequestCycle, String) | |
49 | */ | |
50 | ||
51 | IPage getPage(IRequestCycle cycle, String pageName); | |
52 | ||
53 | /** | |
54 | * Invoked after the engine is done with the page (typically, after the response to the client | |
55 | * has been sent). The page is returned to the pool for later reuse. | |
56 | * | |
57 | * @param page The page to release. | |
58 | */ | |
59 | void releasePage(IPage page); | |
60 | ||
61 | /** | |
62 | * Gets the class resolver used to load all pages / page components. | |
63 | * | |
64 | * @return {@link ClassResolver} instance used to load classes. | |
65 | */ | |
66 | ||
67 | ClassResolver getClassResolver(); | |
68 | } |