public class CglibProxyFactory extends AbstractProxyFactory
ProxyFactory based on CGLIB.com.thoughtworks.proxy.factory,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
CglibProxyFactory.CGLIBInvocationHandlerAdapter
The native invocation handler.
|
private static class |
CglibProxyFactory.ForeignPackageNamingPolicy |
AbstractProxyFactory.CoincidentalInvocationHandlerAdapter| Modifier and Type | Field and Description |
|---|---|
private static java.lang.ThreadLocal<java.util.List<java.lang.Class<?>>> |
cycleGuard |
private CglibProxyFactory.ForeignPackageNamingPolicy |
namingPolicy |
private static long |
serialVersionUID |
private static ProxyFactory |
standardProxyFactory |
getInvoker| Constructor and Description |
|---|
CglibProxyFactory() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canProxy(java.lang.Class<?> type)
Test if the ProxyFactory implementation is capable of creating a proxy instance for the given type.
|
<T> T |
createProxy(Invoker invoker,
java.lang.Class<?>... types)
Create a new proxy instance.
|
private java.lang.Object |
createWithConstructor(java.lang.Class<?> type,
net.sf.cglib.proxy.Enhancer enhancer) |
private java.lang.reflect.Constructor<?> |
getConstructor(java.lang.Class<?> type) |
private java.lang.Class<?>[] |
getInterfaces(java.lang.Class<?>[] types) |
private java.lang.Class<?> |
getSingleClass(java.lang.Class<?>[] types) |
boolean |
isProxyClass(java.lang.Class<?> type)
Test if the given type is a proxy class.
|
private java.lang.Object |
readResolve() |
getInvokerprivate static final long serialVersionUID
private static final java.lang.ThreadLocal<java.util.List<java.lang.Class<?>>> cycleGuard
private static final ProxyFactory standardProxyFactory
private transient CglibProxyFactory.ForeignPackageNamingPolicy namingPolicy
public <T> T createProxy(Invoker invoker, java.lang.Class<?>... types)
Note: If any type the proxy instance must fulfill are all interfaces, the factory will currently create a proxy based on the JDK.
T - The proxy's type.invoker - the invocation handler.types - the types the proxy must emulate.private java.lang.Class<?>[] getInterfaces(java.lang.Class<?>[] types)
private java.lang.Class<?> getSingleClass(java.lang.Class<?>[] types)
private java.lang.Object createWithConstructor(java.lang.Class<?> type,
net.sf.cglib.proxy.Enhancer enhancer)
private java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> type)
public boolean canProxy(java.lang.Class<?> type)
ProxyFactorytype - the type to create a proxy instance for.true if the type is supported.public boolean isProxyClass(java.lang.Class<?> type)
ProxyFactorytype - the type to examine.true if the given type is a proxy class.private java.lang.Object readResolve()