public class PlasticProxyFactoryImpl extends Object implements PlasticProxyFactory
| Modifier and Type | Field and Description |
|---|---|
static String |
INTERNAL_GET_DELEGATE |
| Constructor and Description |
|---|
PlasticProxyFactoryImpl(ClassLoader parentClassLoader,
org.slf4j.Logger logger) |
PlasticProxyFactoryImpl(PlasticManager manager,
org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPlasticClassListener(PlasticClassListener listener) |
void |
clearCache()
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> T |
createProxy(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 as
createProxy(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> T |
createProxy(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 underlying
PlasticClassTransformation for an interface proxy. |
<T> PlasticClassTransformation<T> |
createProxyTransformation(Class<T> interfaceType,
Class<? extends T> implementationType)
Creates the underlying
PlasticClassTransformation for an interface proxy with a given
implementation class. |
ClassLoader |
getClassLoader()
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).
|
Location |
getConstructorLocation(Constructor constructor)
Return a string representation for the constructor (including class and parameters) and (if available) file name
and line number.
|
Location |
getMemberLocation(Member member,
String methodName,
String memberTypeDesc,
ObjectCreator<String> textDescriptionCreator) |
Location |
getMethodLocation(Method method)
Converts a method to a
Location, which includes information about the source file name and line number. |
void |
removePlasticClassListener(PlasticClassListener listener) |
public static final String INTERNAL_GET_DELEGATE
public PlasticProxyFactoryImpl(ClassLoader parentClassLoader, org.slf4j.Logger logger)
public PlasticProxyFactoryImpl(PlasticManager manager, org.slf4j.Logger logger)
public ClassLoader getClassLoader()
PlasticProxyFactorygetClassLoader in interface PlasticProxyFactorypublic <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback)
PlasticProxyFactorycreateProxy(interfacetype, implementationType, callback, true)createProxy in interface PlasticProxyFactoryinterfaceType - interface implemented by proxyimplementationType - a class that implements the interfaceType. It can be null.callback - configures the proxypublic <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback, boolean introduceInterface)
PlasticProxyFactorycreateProxy in interface PlasticProxyFactoryinterfaceType - interface implemented by proxyimplementationType - a class that implements the interfaceType. It can be null.callback - configures the proxypublic <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, PlasticClassTransformer callback)
PlasticProxyFactorycreateProxy in interface PlasticProxyFactoryinterfaceType - interface implemented by proxycallback - configures the proxypublic <T> PlasticClassTransformation<T> createProxyTransformation(Class<T> interfaceType, Class<? extends T> implementationType)
PlasticProxyFactoryPlasticClassTransformation for 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).createProxyTransformation in interface PlasticProxyFactoryinterfaceType - class proxy will extend fromimplementationType - a class that implements the interfaceType. It can be null.public <T> PlasticClassTransformation<T> createProxyTransformation(Class<T> interfaceType)
PlasticProxyFactoryPlasticClassTransformation for 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).createProxyTransformation in interface PlasticProxyFactoryinterfaceType - class proxy will extend frompublic <T> T createProxy(Class<T> interfaceType, ObjectCreator<T> creator, String description)
PlasticProxyFactoryObjectCreator.createObject() (the
creator implementation may decide to
cache the return value as appropriate).createProxy in interface PlasticProxyFactoryT - type of proxyinterfaceType - interface class for proxycreator - object responsible for creating the real objectdescription - the toString() of the proxypublic <T> T createProxy(Class<T> interfaceType, Class<? extends T> implementationType, ObjectCreator<T> creator, String description)
PlasticProxyFactoryObjectCreator.createObject() (the
creator implementation may decide to
cache the return value as appropriate).createProxy in interface PlasticProxyFactoryT - type of proxyinterfaceType - interface class for proxyimplementationType - class that implements the interface type. It may be nullcreator - object responsible for creating the real objectdescription - the toString() of the proxypublic Location getMethodLocation(Method method)
PlasticProxyFactoryLocation, which includes information about the source file name and line number.getMethodLocation in interface PlasticProxyFactorymethod - to look uppublic Location getConstructorLocation(Constructor constructor)
PlasticProxyFactorygetConstructorLocation in interface PlasticProxyFactorypublic void clearCache()
PlasticProxyFactoryclearCache in interface PlasticProxyFactorypublic Location getMemberLocation(Member member, String methodName, String memberTypeDesc, ObjectCreator<String> textDescriptionCreator)
public void addPlasticClassListener(PlasticClassListener listener)
addPlasticClassListener in interface PlasticClassListenerHubpublic void removePlasticClassListener(PlasticClassListener listener)
removePlasticClassListener in interface PlasticClassListenerHub5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.