Package org.apache.tapestry5.internal.services

## Class PageSourceImpl

- java.lang.Object
- - org.apache.tapestry5.internal.services.PageSourceImpl

- All Implemented Interfaces:
    `PageSource`

      public class PageSourceImpl
      extends java.lang.Object
      implements PageSource

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PageSourceImpl​(PageLoader pageLoader, ComponentRequestSelectorAnalyzer selectorAnalyzer, ComponentDependencyRegistry componentDependencyRegistry, ComponentClassResolver componentClassResolver, PageClassLoaderContextManager pageClassLoaderContextManager, PageCachingReferenceTypeService pageCachingReferenceTypeService, boolean productionMode, boolean multipleClassLoaders, org.slf4j.Logger logger)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clearCache()` | Clears the source's cache of loaded pages.
    `java.util.Set<Page>` | `getAllPages()` | Returns all currently loaded pages.
    `Page` | `getPage​(java.lang.String canonicalPageName)` | Returns a loaded instance of the indicated page, using the Locale and other information from the `ComponentResourceSelector` obtained from the `ComponentRequestSelectorAnalyzer`.
    `Page` | `getPage​(java.lang.String canonicalPageName, boolean invalidateUnknownContext, java.util.Set<java.lang.String> alreadyProcessed)` |
    `void` | `setupInvalidation​(InvalidationEventHub classesHub, InvalidationEventHub templatesHub, InvalidationEventHub messagesHub, ResourceChangeTracker resourceChangeTracker)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PageSourceImpl

          public PageSourceImpl​(PageLoader pageLoader,
                                ComponentRequestSelectorAnalyzer selectorAnalyzer,
                                ComponentDependencyRegistry componentDependencyRegistry,
                                ComponentClassResolver componentClassResolver,
                                PageClassLoaderContextManager pageClassLoaderContextManager,
                                PageCachingReferenceTypeService pageCachingReferenceTypeService,
                                @Symbol("tapestry.production-mode")
                                boolean productionMode,
                                @Symbol("tapestry.multiple-classloaders")
                                boolean multipleClassLoaders,
                                org.slf4j.Logger logger)

  - ### Method Detail

    - #### getPage

          public Page getPage​(java.lang.String canonicalPageName)

      Description copied from interface: `PageSource`
      Returns a loaded instance of the indicated page, using the Locale and other information from the `ComponentResourceSelector` obtained from the `ComponentRequestSelectorAnalyzer`.
      Specified by:
        `getPage` in interface `PageSource`
      Returns:
        existing, or newly created, page instance

    - #### getPage

          public Page getPage​(java.lang.String canonicalPageName,
                              boolean invalidateUnknownContext,
                              java.util.Set<java.lang.String> alreadyProcessed)

    - #### setupInvalidation

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

    - #### clearCache

          public void clearCache()

      Description copied from interface: `PageSource`
      Clears the source's cache of loaded pages. This occurs when an outside change to the world invalidates created page instances. Introduced to handle the case where a page has a `DynamicTemplate`, but the underlying `Resource` is noticed to have changed.
      Specified by:
        `clearCache` in interface `PageSource`

    - #### getAllPages

          public java.util.Set<Page> getAllPages()

      Description copied from interface: `PageSource`
      Returns all currently loaded pages. This will include any previously loaded pages not yet reclaimed by the garbage collector, and may include the same page loaded for different `ComponentResourceSelector`s. This is needed for reporting purposes only.
      Specified by:
        `getAllPages` in interface `PageSource`
      See Also:
        `PageCatalog`