Class PlasticProxyFactoryImpl
- java.lang.Object
- 
- org.apache.tapestry5.beanmodel.services.PlasticProxyFactoryImpl
 
- 
- All Implemented Interfaces:
- PlasticProxyFactory,- PlasticClassListenerHub
 
 public class PlasticProxyFactoryImpl extends Object implements PlasticProxyFactory 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringINTERNAL_GET_DELEGATE
 - 
Constructor SummaryConstructors Constructor Description PlasticProxyFactoryImpl(ClassLoader parentClassLoader, org.slf4j.Logger logger)PlasticProxyFactoryImpl(PlasticManager manager, org.slf4j.Logger logger)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPlasticClassListener(PlasticClassListener listener)voidclearCache()Clears any cached information stored by the proxy factory; this is useful in Tapestry development mode when a class loader may have been discarded (because the proxy factory may indirectly keep references to classes loaded by the old class loader).<T> TcreateProxy(Class<T> interfaceType, Class<? extends T> implementationType, ObjectCreator<T> creator, String description)Creates a proxy instance that delegates all methods through a corresponding ObjectCreator.<T> ClassInstantiator<T>createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback)Same ascreateProxy(interfacetype, implementationType, callback, true)<T> ClassInstantiator<T>createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback, boolean introduceInterface)Creates a proxy object that implements the indicated interface and indicated service implementation type, then invokes the callback to further configure the proxy.<T> TcreateProxy(Class<T> interfaceType, ObjectCreator<T> creator, String description)Creates a proxy instance that delegates all methods through a corresponding ObjectCreator.<T> ClassInstantiator<T>createProxy(Class<T> interfaceType, PlasticClassTransformer callback)Creates a proxy object that implements the indicated interface, then invokes the callback to further configure the proxy.<T> PlasticClassTransformation<T>createProxyTransformation(Class<T> interfaceType)Creates the underlyingPlasticClassTransformationfor an interface proxy.<T> PlasticClassTransformation<T>createProxyTransformation(Class<T> interfaceType, Class<? extends T> implementationType)Creates the underlyingPlasticClassTransformationfor an interface proxy with a given implementation class.ClassLoadergetClassLoader()Returns the class loader used when creating new classes, this is a child class loader of another class loader (usually, the thread's context class loader).LocationgetConstructorLocation(Constructor constructor)Return a string representation for the constructor (including class and parameters) and (if available) file name and line number.LocationgetMemberLocation(Member member, String methodName, String memberTypeDesc, ObjectCreator<String> textDescriptionCreator)LocationgetMethodLocation(Method method)Converts a method to aLocation, which includes information about the source file name and line number.voidremovePlasticClassListener(PlasticClassListener listener)
 
- 
- 
- 
Field Detail- 
INTERNAL_GET_DELEGATEpublic static final String INTERNAL_GET_DELEGATE - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
PlasticProxyFactoryImplpublic PlasticProxyFactoryImpl(ClassLoader parentClassLoader, org.slf4j.Logger logger) 
 - 
PlasticProxyFactoryImplpublic PlasticProxyFactoryImpl(PlasticManager manager, org.slf4j.Logger logger) 
 
- 
 - 
Method Detail- 
getClassLoaderpublic ClassLoader getClassLoader() Description copied from interface:PlasticProxyFactoryReturns the class loader used when creating new classes, this is a child class loader of another class loader (usually, the thread's context class loader).- Specified by:
- getClassLoaderin interface- PlasticProxyFactory
 
 - 
createProxypublic <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback) Description copied from interface:PlasticProxyFactorySame ascreateProxy(interfacetype, implementationType, callback, true)- Specified by:
- createProxyin interface- PlasticProxyFactory
- Parameters:
- interfaceType- interface implemented by proxy
- implementationType- a class that implements the interfaceType. It can be null.
- callback- configures the proxy
- Returns:
- instantiator that can be used to create an instance of the proxy class
 
 - 
createProxypublic <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback, boolean introduceInterface) Description copied from interface:PlasticProxyFactoryCreates a proxy object that implements the indicated interface and indicated service implementation type, then invokes the callback to further configure the proxy.- Specified by:
- createProxyin interface- PlasticProxyFactory
- Parameters:
- interfaceType- interface implemented by proxy
- implementationType- a class that implements the interfaceType. It can be null.
- callback- configures the proxy
- Returns:
- instantiator that can be used to create an instance of the proxy class
 
 - 
createProxypublic <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, PlasticClassTransformer callback) Description copied from interface:PlasticProxyFactoryCreates a proxy object that implements the indicated interface, then invokes the callback to further configure the proxy.- Specified by:
- createProxyin interface- PlasticProxyFactory
- Parameters:
- interfaceType- interface implemented by proxy
- callback- configures the proxy
- Returns:
- instantiator that can be used to create an instance of the proxy class
 
 - 
createProxyTransformationpublic <T> PlasticClassTransformation<T> createProxyTransformation(Class<T> interfaceType, Class<? extends T> implementationType) Description copied from interface:PlasticProxyFactoryCreates the underlyingPlasticClassTransformationfor an interface proxy with a given implementation class. This should only be used in the cases where encapsulating the PlasticClass construction into a callback is not feasible (which is the case for some of the older APIs inside Tapestry IoC).- Specified by:
- createProxyTransformationin interface- PlasticProxyFactory
- Parameters:
- interfaceType- class proxy will extend from
- implementationType- a class that implements the interfaceType. It can be null.
- Returns:
- transformation from which an instantiator may be created
 
 - 
createProxyTransformationpublic <T> PlasticClassTransformation<T> createProxyTransformation(Class<T> interfaceType) Description copied from interface:PlasticProxyFactoryCreates the underlyingPlasticClassTransformationfor an interface proxy. This should only be used in the cases where encapsulating the PlasticClass construction into a callback is not feasible (which is the case for some of the older APIs inside Tapestry IoC).- Specified by:
- createProxyTransformationin interface- PlasticProxyFactory
- Parameters:
- interfaceType- class proxy will extend from
- Returns:
- transformation from which an instantiator may be created
 
 - 
createProxypublic <T> T createProxy(Class<T> interfaceType, ObjectCreator<T> creator, String description) Description copied from interface:PlasticProxyFactoryCreates a proxy instance that delegates all methods through a corresponding ObjectCreator. Each method invocation on the proxy will route throughObjectCreator.createObject()(the creator implementation may decide to cache the return value as appropriate).- Specified by:
- createProxyin interface- PlasticProxyFactory
- Type Parameters:
- T- type of proxy
- Parameters:
- interfaceType- interface class for proxy
- creator- object responsible for creating the real object
- description- the- toString()of the proxy
- Returns:
- proxy instance
 
 - 
createProxypublic <T> T createProxy(Class<T> interfaceType, Class<? extends T> implementationType, ObjectCreator<T> creator, String description) Description copied from interface:PlasticProxyFactoryCreates a proxy instance that delegates all methods through a corresponding ObjectCreator. Each method invocation on the proxy will route throughObjectCreator.createObject()(the creator implementation may decide to cache the return value as appropriate).- Specified by:
- createProxyin interface- PlasticProxyFactory
- Type Parameters:
- T- type of proxy
- Parameters:
- interfaceType- interface class for proxy
- implementationType- class that implements the interface type. It may be null
- creator- object responsible for creating the real object
- description- the- toString()of the proxy
- Returns:
- proxy instance
 
 - 
getMethodLocationpublic Location getMethodLocation(Method method) Description copied from interface:PlasticProxyFactoryConverts a method to aLocation, which includes information about the source file name and line number.- Specified by:
- getMethodLocationin interface- PlasticProxyFactory
- Parameters:
- method- to look up
- Returns:
- the location (identifying the method and possibly, the line number within the method)
 
 - 
getConstructorLocationpublic Location getConstructorLocation(Constructor constructor) Description copied from interface:PlasticProxyFactoryReturn a string representation for the constructor (including class and parameters) and (if available) file name and line number.- Specified by:
- getConstructorLocationin interface- PlasticProxyFactory
- Returns:
- the location (identifying the constructor and possibly, the line number within the method)
 
 - 
clearCachepublic void clearCache() Description copied from interface:PlasticProxyFactoryClears any cached information stored by the proxy factory; this is useful in Tapestry development mode when a class loader may have been discarded (because the proxy factory may indirectly keep references to classes loaded by the old class loader).- Specified by:
- clearCachein interface- PlasticProxyFactory
 
 - 
getMemberLocationpublic Location getMemberLocation(Member member, String methodName, String memberTypeDesc, ObjectCreator<String> textDescriptionCreator) 
 - 
addPlasticClassListenerpublic void addPlasticClassListener(PlasticClassListener listener) - Specified by:
- addPlasticClassListenerin interface- PlasticClassListenerHub
 
 - 
removePlasticClassListenerpublic void removePlasticClassListener(PlasticClassListener listener) - Specified by:
- removePlasticClassListenerin interface- PlasticClassListenerHub
 
 
- 
 
-