org.apache.tapestry5.internal.pageload
Class PageLoaderImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.pageload.PageLoaderImpl
All Implemented Interfaces:
ComponentAssemblerSource, PageLoader, InvalidationListener

public class PageLoaderImpl
extends Object
implements PageLoader, InvalidationListener, ComponentAssemblerSource

There's still a lot of room to beef up ComponentAssembler and EmbeddedComponentAssembler to perform more static analysis.

Loading a page involves a recurive process of creating ComponentAssemblers: for the root component, then down the tree for each embedded component. A ComponentAssembler is largely a collection of PageAssemblyActions. Once created, a ComponentAssembler can quickly assemble any number of component instances. All of the expensive logic, such as fitting template tokens together and matching parameters to bindings, is done as part of the one-time construction of the ComponentAssembler. The end result removes a huge amount of computational redundancy that was present in Tapestry 5.0, but to understand this, you need to split your mind into two phases: construction (of the ComponentAssemblers) and assembly. It's twisted ... and perhaps a bit functional and Monadic.

And truly, This is the Tapestry Heart, This is the Tapestry Soul...


Constructor Summary
PageLoaderImpl(ComponentInstantiatorSource instantiatorSource, ComponentTemplateSource templateSource, PageElementFactory elementFactory, ComponentPageElementResourcesSource resourcesSource, ComponentClassResolver componentClassResolver, PersistentFieldManager persistentFieldManager, StringInterner interner)
           
 
Method Summary
 org.apache.tapestry5.internal.pageload.ComponentAssembler getAssembler(String className, Locale locale)
          Gets (and possibly creates) a component assembler for the indicated class name and locale.
 Page loadPage(String logicalPageName, Locale locale)
          Loads the page in the given locale.
 void objectWasInvalidated()
          Invoked to indicate that some object is invalid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageLoaderImpl

public PageLoaderImpl(ComponentInstantiatorSource instantiatorSource,
                      ComponentTemplateSource templateSource,
                      PageElementFactory elementFactory,
                      ComponentPageElementResourcesSource resourcesSource,
                      ComponentClassResolver componentClassResolver,
                      PersistentFieldManager persistentFieldManager,
                      StringInterner interner)
Method Detail

objectWasInvalidated

public void objectWasInvalidated()
Description copied from interface: InvalidationListener
Invoked to indicate that some object is invalid. The receiver should clear its cache.

Specified by:
objectWasInvalidated in interface InvalidationListener

loadPage

public Page loadPage(String logicalPageName,
                     Locale locale)
Description copied from interface: PageLoader
Loads the page in the given locale.

Specified by:
loadPage in interface PageLoader
Parameters:
logicalPageName - the canonicalized logical name of the page, which will be made available via Page.getName() and ComponentResourcesCommon.getPageName() (for any component within the page).
locale - the locale to load the page and its components , which will be made available via Page.getLocale() and ComponentResourcesCommon.getLocale() (for any component within the page)
See Also:
Page.getLocale()

getAssembler

public org.apache.tapestry5.internal.pageload.ComponentAssembler getAssembler(String className,
                                                                              Locale locale)
Description copied from interface: ComponentAssemblerSource
Gets (and possibly creates) a component assembler for the indicated class name and locale.

Specified by:
getAssembler in interface ComponentAssemblerSource


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.