Class PageClassLoaderContextManagerImpl
- java.lang.Object
-
- org.apache.tapestry5.services.pageload.PageClassLoaderContextManagerImpl
-
- All Implemented Interfaces:
PageClassLoaderContextManager
public class PageClassLoaderContextManagerImpl extends java.lang.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
All Methods Instance Methods Concrete 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.void
preloadContexts()
Preloads the page classloader contexts.
-
-
-
Constructor Detail
-
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 Detail
-
invalidateUnknownContext
public void invalidateUnknownContext()
Description copied from interface:PageClassLoaderContextManager
Invalidates the "unknown" page classloader context context.- Specified by:
invalidateUnknownContext
in interfacePageClassLoaderContextManager
-
initialize
public void initialize(PageClassLoaderContext root, java.util.function.Function<java.lang.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 interfacePageClassLoaderContextManager
-
get
public PageClassLoaderContext get(java.lang.String className)
Description copied from interface:PageClassLoaderContextManager
Processes a class, given its class name and the root context.- Specified by:
get
in interfacePageClassLoaderContextManager
- Parameters:
className
- the class fully qualified name. ClassLoader} and returns a new PlasticProxyFactory.- Returns:
- the
PageClassLoaderContext
associated with that class.
-
clear
public void clear(java.lang.String className)
Description copied from interface:PageClassLoaderContextManager
Removes one specific class from this manager, invalidating the context where it is.- Specified by:
clear
in interfacePageClassLoaderContextManager
-
invalidate
public java.util.Set<java.lang.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 interfacePageClassLoaderContextManager
-
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 interfacePageClassLoaderContextManager
-
getRoot
public PageClassLoaderContext getRoot()
Description copied from interface:PageClassLoaderContextManager
Returns the root context.- Specified by:
getRoot
in interfacePageClassLoaderContextManager
-
isMerging
public boolean isMerging()
Description copied from interface:PageClassLoaderContextManager
Returns whether contexts are being merged.- Specified by:
isMerging
in interfacePageClassLoaderContextManager
-
clear
public void clear()
Description copied from interface:PageClassLoaderContextManager
Clears any state held by this manager.- Specified by:
clear
in interfacePageClassLoaderContextManager
-
getClassInstance
public java.lang.Class<?> getClassInstance(java.lang.Class<?> clasz, java.lang.String pageName)
Description copied from interface:PageClassLoaderContextManager
Returns the Class instance appropriate for a given component given a page name.- Specified by:
getClassInstance
in interfacePageClassLoaderContextManager
- 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 interfacePageClassLoaderContextManager
-
preloadContexts
public void preloadContexts()
Description copied from interface:PageClassLoaderContextManager
Preloads the page classloader contexts.- Specified by:
preloadContexts
in interfacePageClassLoaderContextManager
-
-