Class ComponentInstantiatorSourceImpl
java.lang.Object
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl
- All Implemented Interfaces:
Runnable,ComponentInstantiatorSource,UpdateListener,PlasticClassListener,PlasticClassTransformer,PlasticManagerDelegate
public final class ComponentInstantiatorSourceImpl
extends Object
implements ComponentInstantiatorSource, UpdateListener, Runnable, PlasticManagerDelegate, PlasticClassListener
A wrapper around a
PlasticManager that allows certain classes to be modified as they are loaded.-
Constructor Summary
ConstructorsConstructorDescriptionComponentInstantiatorSourceImpl(org.slf4j.Logger logger, LoggerSource loggerSource, PlasticProxyFactory proxyFactory, ComponentClassTransformWorker2 transformerChain, ClasspathURLConverter classpathURLConverter, OperationTracker tracker, Map<String, ControlledPackageType> configuration, boolean productionMode, boolean multipleClassLoaders, ComponentClassResolver resolver, InternalComponentInvalidationEventHub invalidationHub, PageClassLoaderContextManager pageClassLoaderContextManager, ComponentDependencyRegistry componentDependencyRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked to force the receiver to check for updates to whatever underlying resources it makes use of.voidclassWillLoad(PlasticClassEvent event) Invoked just before a class is to be loaded.<T> ClassInstantiator<T>configureInstantiator(String className, ClassInstantiator<T> instantiator) Configures the instantiator for a transformed PlasticClass.booleanChecks to see if a fully qualified class name exists.voidForces invalidation logic, as if a component class on the disk had changed, forcing a reload of all pages and components.getInstantiator(String className) Given the name of a component class, provides an instantiator for that component.Returns a proxy factory that can be used to generate additional classes around enhanced classes, or create subclasses of enhanced classes.voidvoidrun()voidtransform(PlasticClass plasticClass) Perform whatever transformations are appropriate on this PlasticClass.
-
Constructor Details
-
ComponentInstantiatorSourceImpl
public ComponentInstantiatorSourceImpl(org.slf4j.Logger logger, LoggerSource loggerSource, @Builtin PlasticProxyFactory proxyFactory, @Primary ComponentClassTransformWorker2 transformerChain, ClasspathURLConverter classpathURLConverter, OperationTracker tracker, Map<String, ControlledPackageType> configuration, @Symbol("tapestry.production-mode") boolean productionMode, @Symbol("tapestry.multiple-classloaders") boolean multipleClassLoaders, ComponentClassResolver resolver, InternalComponentInvalidationEventHub invalidationHub, PageClassLoaderContextManager pageClassLoaderContextManager, ComponentDependencyRegistry componentDependencyRegistry)
-
-
Method Details
-
listenForUpdates
-
checkForUpdates
Description copied from interface:UpdateListenerInvoked to force the receiver to check for updates to whatever underlying resources it makes use of.- Specified by:
checkForUpdatesin interfaceUpdateListener
-
forceComponentInvalidation
Description copied from interface:ComponentInstantiatorSourceForces invalidation logic, as if a component class on the disk had changed, forcing a reload of all pages and components.- Specified by:
forceComponentInvalidationin interfaceComponentInstantiatorSource
-
run
-
getInstantiator
Description copied from interface:ComponentInstantiatorSourceGiven the name of a component class, provides an instantiator for that component. Instantiators are cached, so repeated calls to this method with the same class name will return the same instance; however, callers should also be aware that the instantiators may lose validity after an invalidation (caused by changes to external Java class files).- Specified by:
getInstantiatorin interfaceComponentInstantiatorSource- Parameters:
className- FQCN to find (and perhaps transform and load)- Returns:
- an object which can instantiate an instance of the component
-
exists
Description copied from interface:ComponentInstantiatorSourceChecks to see if a fully qualified class name exists. This method appears to exist only for testing.- Specified by:
existsin interfaceComponentInstantiatorSource- Parameters:
className- name of class to check- Returns:
- true if the class exists (there's a ".class" file), false otherwise
-
getProxyFactory
Description copied from interface:ComponentInstantiatorSourceReturns a proxy factory that can be used to generate additional classes around enhanced classes, or create subclasses of enhanced classes.- Specified by:
getProxyFactoryin interfaceComponentInstantiatorSource
-
transform
Description copied from interface:PlasticClassTransformerPerform whatever transformations are appropriate on this PlasticClass.- Specified by:
transformin interfacePlasticClassTransformer
-
configureInstantiator
public <T> ClassInstantiator<T> configureInstantiator(String className, ClassInstantiator<T> instantiator) Description copied from interface:PlasticManagerDelegateConfigures the instantiator for a transformed PlasticClass.- Specified by:
configureInstantiatorin interfacePlasticManagerDelegate- Parameters:
className- fully qualified class name that was transformedinstantiator- default instantiator, which has an emptyInstanceContext- Returns:
- the same instantiator, or a new one configured with additional
InstanceContextvalues
-
classWillLoad
Description copied from interface:PlasticClassListenerInvoked just before a class is to be loaded. Separate events are fired for supporting classes before the event for the primary class (the class being transformed or created from scratch).- Specified by:
classWillLoadin interfacePlasticClassListener- Parameters:
event- describes the class to be loaded, and gives access to its disassembled bytecode (for debugging purposes)
-