Package org.apache.tapestry5.internal.pageload

## Class PageLoaderImpl

- java.lang.Object
- - org.apache.tapestry5.internal.pageload.PageLoaderImpl

- All Implemented Interfaces:
    `ComponentAssemblerSource`, `PageLoader`

      public class PageLoaderImpl
      extends java.lang.Object
      implements PageLoader, ComponentAssemblerSource

  There's still a lot of room to beef up `ComponentAssembler` and `EmbeddedComponentAssembler` to perform more static analysis, but that may no longer be necessary, given the switch to shared (non-pooled) pages in 5.2. Loading a page involves a recursive process of creating `ComponentAssembler`s: for the root component, then down the tree for each embedded component. A ComponentAssembler is largely a collection of `PageAssemblyAction`s. 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. And truly, This is the Tapestry Heart, This is the Tapestry Soul...

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PageLoaderImpl​(ComponentInstantiatorSource instantiatorSource, ComponentTemplateSource templateSource, PageElementFactory elementFactory, ComponentPageElementResourcesSource resourcesSource, ComponentClassResolver componentClassResolver, PersistentFieldManager persistentFieldManager, StringInterner interner, OperationTracker tracker, PerthreadManager perThreadManager, org.slf4j.Logger logger, MetaDataLocator metaDataLocator)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clearCache()` |
    `org.apache.tapestry5.internal.pageload.ComponentAssembler` | `getAssembler​(java.lang.String className, ComponentResourceSelector selector)` | Gets (and possibly creates) a component assembler for the indicated class name and selector.
    `Page` | `loadPage​(java.lang.String logicalPageName, ComponentResourceSelector selector)` | Loads the page for the indicated selector.
    `void` | `setupInvalidation​(InvalidationEventHub classesHub, InvalidationEventHub templatesHub, InvalidationEventHub messagesHub)` |

    - ### 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,
                                OperationTracker tracker,
                                PerthreadManager perThreadManager,
                                org.slf4j.Logger logger,
                                MetaDataLocator metaDataLocator)

  - ### Method Detail

    - #### setupInvalidation

          @PostInjection
          public void setupInvalidation​(@ComponentClasses
                                        InvalidationEventHub classesHub,
                                        @ComponentTemplates
                                        InvalidationEventHub templatesHub,
                                        @ComponentMessages
                                        InvalidationEventHub messagesHub)

    - #### clearCache

          public void clearCache()

    - #### loadPage

          public Page loadPage​(java.lang.String logicalPageName,
                               ComponentResourceSelector selector)

      Description copied from interface: `PageLoader`
      Loads the page for the indicated selector.
      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).
        `selector` - Encapsulates the locale and other information used to select the component's template and message catalog resources.

    - #### getAssembler

          public org.apache.tapestry5.internal.pageload.ComponentAssembler getAssembler​(java.lang.String className,
                                                                                        ComponentResourceSelector selector)

      Description copied from interface: `ComponentAssemblerSource`
      Gets (and possibly creates) a component assembler for the indicated class name and selector.
      Specified by:
        `getAssembler` in interface `ComponentAssemblerSource`