01: // Copyright 2006, 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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.internal.services;
16:
17: import java.util.Locale;
18:
19: import org.apache.tapestry.ComponentResourcesCommon;
20: import org.apache.tapestry.internal.event.InvalidationEventHub;
21: import org.apache.tapestry.internal.structure.Page;
22:
23: /**
24: * Instantiates a fully loaded, configured instance of a Tapestry page. This is a recursive process,
25: * since part of loading a page is to load the page elements for the page, many of which are
26: * components. Further, in some cases, the full component tree is not identified until after each
27: * component's template is loaded. Because this is an expensive process, loaded pages will be used
28: * for many requests (on behalf of many different users) and will be pooled between requests.
29: *
30: * @see PagePool
31: * @see RequestPageCache
32: */
33: public interface PageLoader extends InvalidationEventHub {
34: /**
35: * Loads the page in the given locale.
36: *
37: * @param logicalPageName
38: * the <em>canonicalized</em> logical name of the page, which will be made
39: * available via {@link Page#getLogicalName()} and
40: * {@link ComponentResourcesCommon#getPageName()} (for any component within the
41: * page).
42: * @param locale
43: * the locale to load the page and its components , which will be made available via
44: * {@link Page#getLocale()} and {@link ComponentResourcesCommon#getLocale()} (for any
45: * component within the page)
46: * @see Page#getLocale()
47: */
48: Page loadPage(String logicalPageName, Locale locale);
49: }
|