Package org.apache.tapestry5.services.pageload

## Interface PageClassLoaderContextManager

- All Known Implementing Classes:
    `PageClassLoaderContextManagerImpl`

      public interface PageClassLoaderContextManager

  Service that creates PageClassLoaderContext instances (except the root one) when a class in a controlled page is first used in the Tapestry page pool. Existing contexts may be reused for a given class, specially when in production mode.
  Since:
    5.8.3
  See Also:
    `ComponentInstantiatorSource`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clear()` | Clears any state held by this manager.
    `void` | `clear​(java.lang.String className)` | Removes one specific class from this manager, invalidating the context where it is.
    `PageClassLoaderContext` | `get​(java.lang.String className)` | Processes a class, given its class name and the root context.
    `java.lang.Class<?>` | `getClassInstance​(java.lang.Class<?> clasz, java.lang.String pageName)` | Returns the Class instance appropriate for a given component given a page name.
    `PageClassLoaderContext` | `getRoot()` | Returns the root context.
    `void` | `initialize​(PageClassLoaderContext root, java.util.function.Function<java.lang.ClassLoader,​PlasticProxyFactory> plasticProxyFactoryProvider)` | Initializes this service with the root context and a Plastic proxy factory provider.
    `java.util.Set<java.lang.String>` | `invalidate​(PageClassLoaderContext... contexts)` | Invalidates page classloader contexts and returns a set containing the names of all classes that should be invalidated.
    `void` | `invalidateAndFireInvalidationEvents​(PageClassLoaderContext... contexts)` | Invalidates page classloader contexts and invalidates the classes in the context as well.
    `void` | `invalidateUnknownContext()` | Invalidates the "unknown" page classloader context context.
    `boolean` | `isMerging()` | Returns whether contexts are being merged.
    `void` | `preload()` | Preloads all data, first by collecting dependency data for all existing pages and the components, mixins and superclasses they use, then creating the page classloader contexts.

- - ### Method Detail

    - #### get

          PageClassLoaderContext get​(java.lang.String className)

      Processes a class, given its class name and the root context.
      Parameters:
        `className` - the class fully qualified name. ClassLoader} and returns a new PlasticProxyFactory.
      Returns:
        the `PageClassLoaderContext` associated with that class.

    - #### invalidate

          java.util.Set<java.lang.String> invalidate​(PageClassLoaderContext... contexts)

      Invalidates page classloader contexts and returns a set containing the names of all classes that should be invalidated.

    - #### invalidateAndFireInvalidationEvents

          void invalidateAndFireInvalidationEvents​(PageClassLoaderContext... contexts)

      Invalidates page classloader contexts and invalidates the classes in the context as well.

    - #### getRoot

          PageClassLoaderContext getRoot()

      Returns the root context.

    - #### clear

          void clear()

      Clears any state held by this manager.

    - #### isMerging

          boolean isMerging()

      Returns whether contexts are being merged.

    - #### clear

          void clear​(java.lang.String className)

      Removes one specific class from this manager, invalidating the context where it is.

    - #### initialize

          void initialize​(PageClassLoaderContext root,
                          java.util.function.Function<java.lang.ClassLoader,​PlasticProxyFactory> plasticProxyFactoryProvider)

      Initializes this service with the root context and a Plastic proxy factory provider. Method can only be called once. None of the parameters may be null.

    - #### getClassInstance

          java.lang.Class<?> getClassInstance​(java.lang.Class<?> clasz,
                                              java.lang.String pageName)

      Returns the Class instance appropriate for a given component given a page name.
      Parameters:
        `clasz` - the class instance.
        `pageName` - the page name.
      Returns:
        a Class instance.

    - #### invalidateUnknownContext

          void invalidateUnknownContext()

      Invalidates the "unknown" page classloader context context.

    - #### preload

          void preload()

      Preloads all data, first by collecting dependency data for all existing pages and the components, mixins and superclasses they use, then creating the page classloader contexts.