org.apache.tapestry.pageload
Class PageLoader

java.lang.Object
  extended by org.apache.tapestry.pageload.PageLoader
All Implemented Interfaces:
IPageLoader

public class PageLoader
extends Object
implements IPageLoader

Runs the process of building the component hierarchy for an entire page.

This class is not threadsafe; however, PageSource creates a new instance of it for each page to be loaded, which bypasses multithreading issues.

Author:
Howard Lewis Ship

Constructor Summary
PageLoader(IRequestCycle cycle)
          Constructor.
 
Method Summary
 IComponent createImplicitComponent(IRequestCycle cycle, IComponent container, String componentId, String componentType, ILocation location)
          Invoked to create an implicit component (one which is defined in the containing component's template, rather that in the containing component's specification).
 IEngine getEngine()
          Returns the engine for which this page loader is curently constructing a page.
 ITemplateSource getTemplateSource()
          A convienience; returns the template source provided by the engine.
 IPage loadPage(String name, INamespace namespace, IRequestCycle cycle, IComponentSpecification specification)
          Invoked by the PageSource to load a specific page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageLoader

public PageLoader(IRequestCycle cycle)
Constructor.

Method Detail

createImplicitComponent

public IComponent createImplicitComponent(IRequestCycle cycle,
                                          IComponent container,
                                          String componentId,
                                          String componentType,
                                          ILocation location)
Invoked to create an implicit component (one which is defined in the containing component's template, rather that in the containing component's specification).

Specified by:
createImplicitComponent in interface IPageLoader
Since:
3.0
See Also:
BaseComponentTemplateLoader

loadPage

public IPage loadPage(String name,
                      INamespace namespace,
                      IRequestCycle cycle,
                      IComponentSpecification specification)
Invoked by the PageSource to load a specific page. This method is not reentrant ... the PageSource ensures that any given instance of PageLoader is loading only a single page at a time. The page is immediately attached to the engine.

Parameters:
name - the simple (unqualified) name of the page to load
namespace - from which the page is to be loaded (used when resolving components embedded by the page)
cycle - the request cycle the page is initially loaded for (this is used to define the locale of the new page, and provide access to the corect specification source, etc.).
specification - the specification for the page

getEngine

public IEngine getEngine()
Description copied from interface: IPageLoader
Returns the engine for which this page loader is curently constructing a page.

Specified by:
getEngine in interface IPageLoader

getTemplateSource

public ITemplateSource getTemplateSource()
Description copied from interface: IPageLoader
A convienience; returns the template source provided by the engine.

Specified by:
getTemplateSource in interface IPageLoader