Package org.apache.tapestry5.services.pageload

# Class PageClassLoaderContextManagerImpl

java.lang.Object
org.apache.tapestry5.services.pageload.PageClassLoaderContextManagerImpl

All Implemented Interfaces:
  `PageClassLoaderContextManager`

public class PageClassLoaderContextManagerImpl extends Object implements PageClassLoaderContextManager
Default PageClassLoaderContextManager implementation.

Since:
  5.8.3

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PageClassLoaderContextManagerImpl(ComponentDependencyRegistry componentDependencyRegistry, ComponentClassResolver componentClassResolver, InternalComponentInvalidationEventHub invalidationHub, InvalidationEventHub componentClassesInvalidationEventHub, boolean productionMode, boolean multipleClassLoaders)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  Clears any state held by this manager.
  `void`
  `clear(String className)`
  Removes one specific class from this manager, invalidating the context where it is.
  `PageClassLoaderContext`
  `get(String className)`
  Processes a class, given its class name and the root context.
  `Class<?>`
  `getClassInstance(Class<?> clasz, 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, Function<ClassLoader,PlasticProxyFactory> plasticProxyFactoryProvider)`
  Initializes this service with the root context and a Plastic proxy factory provider.
  `Set<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.
  `void`
  `preloadContexts()`
  Preloads the page classloader contexts.

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

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

- ## Constructor Details

  - ### PageClassLoaderContextManagerImpl

    public PageClassLoaderContextManagerImpl(ComponentDependencyRegistry componentDependencyRegistry, ComponentClassResolver componentClassResolver, InternalComponentInvalidationEventHub invalidationHub, @ComponentClasses InvalidationEventHub componentClassesInvalidationEventHub, @Symbol("tapestry.production-mode") boolean productionMode, @Symbol("tapestry.multiple-classloaders") boolean multipleClassLoaders)

- ## Method Details

  - ### invalidateUnknownContext

    public void invalidateUnknownContext()
    Description copied from interface: `PageClassLoaderContextManager`
    Invalidates the "unknown" page classloader context context.
    Specified by:
      `invalidateUnknownContext` in interface `PageClassLoaderContextManager`

  - ### initialize

    public void initialize(PageClassLoaderContext root, Function<ClassLoader,PlasticProxyFactory> plasticProxyFactoryProvider)
    Description copied from interface: `PageClassLoaderContextManager`
    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.
    Specified by:
      `initialize` in interface `PageClassLoaderContextManager`

  - ### get

    public PageClassLoaderContext get(String className)
    Description copied from interface: `PageClassLoaderContextManager`
    Processes a class, given its class name and the root context.
    Specified by:
      `get` in interface `PageClassLoaderContextManager`
    Parameters:
      `className` - the class fully qualified name. ClassLoader} and returns a new PlasticProxyFactory.
    Returns:
      the `PageClassLoaderContext` associated with that class.

  - ### clear

    public void clear(String className)
    Description copied from interface: `PageClassLoaderContextManager`
    Removes one specific class from this manager, invalidating the context where it is.
    Specified by:
      `clear` in interface `PageClassLoaderContextManager`

  - ### invalidate

    public Set<String> invalidate(PageClassLoaderContext... contexts)
    Description copied from interface: `PageClassLoaderContextManager`
    Invalidates page classloader contexts and returns a set containing the names of all classes that should be invalidated.
    Specified by:
      `invalidate` in interface `PageClassLoaderContextManager`

  - ### invalidateAndFireInvalidationEvents

    public void invalidateAndFireInvalidationEvents(PageClassLoaderContext... contexts)
    Description copied from interface: `PageClassLoaderContextManager`
    Invalidates page classloader contexts and invalidates the classes in the context as well.
    Specified by:
      `invalidateAndFireInvalidationEvents` in interface `PageClassLoaderContextManager`

  - ### getRoot

    public PageClassLoaderContext getRoot()
    Description copied from interface: `PageClassLoaderContextManager`
    Returns the root context.
    Specified by:
      `getRoot` in interface `PageClassLoaderContextManager`

  - ### isMerging

    public boolean isMerging()
    Description copied from interface: `PageClassLoaderContextManager`
    Returns whether contexts are being merged.
    Specified by:
      `isMerging` in interface `PageClassLoaderContextManager`

  - ### clear

    public void clear()
    Description copied from interface: `PageClassLoaderContextManager`
    Clears any state held by this manager.
    Specified by:
      `clear` in interface `PageClassLoaderContextManager`

  - ### getClassInstance

    public Class<?> getClassInstance(Class<?> clasz, String pageName)
    Description copied from interface: `PageClassLoaderContextManager`
    Returns the Class instance appropriate for a given component given a page name.
    Specified by:
      `getClassInstance` in interface `PageClassLoaderContextManager`
    Parameters:
      `clasz` - the class instance.
      `pageName` - the page name.
    Returns:
      a Class instance.

  - ### preload

    public void preload()
    Description copied from interface: `PageClassLoaderContextManager`
    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.
    Specified by:
      `preload` in interface `PageClassLoaderContextManager`

  - ### preloadContexts

    public void preloadContexts()
    Description copied from interface: `PageClassLoaderContextManager`
    Preloads the page classloader contexts.
    Specified by:
      `preloadContexts` in interface `PageClassLoaderContextManager`