public class InterceptedSubclassFactory<T> extends ProxyFactory<T>
| Modifier and Type | Field and Description |
|---|---|
static String |
PROXY_SUFFIX |
CONSTRUCTED_FLAG_NAME, DEFAULT_METHOD_RESOLVER, DEFAULT_PROXY_PACKAGE, INIT_METHOD_NAME, LBEAN_IDENTIFIER, LJAVA_LANG_BYTE, LJAVA_LANG_CLASS, LJAVA_LANG_OBJECT, LJAVA_LANG_REFLECT_METHOD, LJAVA_LANG_STRING, LJAVA_LANG_THREAD_LOCAL, METHOD_HANDLER_FIELD_NAME| Constructor and Description |
|---|
InterceptedSubclassFactory(String contextId,
Class<?> proxiedBeanType,
Set<? extends Type> typeClosure,
Bean<?> bean,
Set<MethodSignature> enhancedMethodSignatures) |
InterceptedSubclassFactory(String contextId,
Class<?> proxiedBeanType,
Set<? extends Type> typeClosure,
String proxyName,
Bean<?> bean,
Set<MethodSignature> enhancedMethodSignatures)
Creates a new proxy factory when the name of the proxy class is already
known, such as during de-serialization
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInterfacesFromTypeClosure(Set<? extends Type> typeClosure,
Class<?> proxiedBeanType) |
protected void |
addMethods(ClassFile proxyClassType,
ClassMethod staticConstructor) |
protected void |
addMethodsFromClass(ClassFile proxyClassType,
ClassMethod staticConstructor) |
protected void |
addSpecialMethods(ClassFile proxyClassType,
ClassMethod staticConstructor)
Adds methods requiring special implementations rather than just
delegation.
|
protected void |
createForwardingMethodBody(ClassMethod classMethod,
MethodInformation method,
ClassMethod staticConstructor) |
protected void |
createInterceptorBody(ClassMethod method,
MethodInformation methodInfo,
boolean delegateToSuper,
ClassMethod staticConstructor)
Creates the given method on the proxy class where the implementation
forwards the call directly to the method handler.
|
Class<?> |
getBeanType() |
protected String |
getProxyNameSuffix()
Returns a suffix to append to the name of the proxy class.
|
protected static void |
invokeMethodHandler(ClassMethod method,
MethodInformation methodInfo,
boolean addReturnInstruction,
BytecodeMethodResolver bytecodeMethodResolver,
boolean addProceed,
ClassMethod staticConstructor)
calls methodHandler.invoke for a given method
|
protected boolean |
isCreatingProxy() |
addAdditionalInterfaces, addConstructedGuardToMethodBody, addConstructors, addFields, addInterface, addSerializationSupport, create, createInterceptorBody, createSpecialMethodBody, generateEqualsMethod, generateHashCodeMethod, getAdditionalInterfaces, getBaseProxyName, getBean, getCachedProxyClass, getContextId, getProxyClass, invokeMethodHandler, isProxy, isUsingUnsafeInstantiators, resolveClassLoaderForBeanProxy, setBeanInstancepublic static final String PROXY_SUFFIX
public InterceptedSubclassFactory(String contextId, Class<?> proxiedBeanType, Set<? extends Type> typeClosure, Bean<?> bean, Set<MethodSignature> enhancedMethodSignatures)
public InterceptedSubclassFactory(String contextId, Class<?> proxiedBeanType, Set<? extends Type> typeClosure, String proxyName, Bean<?> bean, Set<MethodSignature> enhancedMethodSignatures)
proxiedBeanType - the super-class for this proxy classtypeClosure - the bean types of the beanenhancedMethodSignatures - a restricted set of methods that need to be interceptedpublic void addInterfacesFromTypeClosure(Set<? extends Type> typeClosure, Class<?> proxiedBeanType)
addInterfacesFromTypeClosure in class ProxyFactory<T>protected String getProxyNameSuffix()
getProxyNameSuffix in class ProxyFactory<T>protected void addMethods(ClassFile proxyClassType, ClassMethod staticConstructor)
addMethods in class ProxyFactory<T>protected void addMethodsFromClass(ClassFile proxyClassType, ClassMethod staticConstructor)
addMethodsFromClass in class ProxyFactory<T>protected void createForwardingMethodBody(ClassMethod classMethod, MethodInformation method, ClassMethod staticConstructor)
createForwardingMethodBody in class ProxyFactory<T>protected void createInterceptorBody(ClassMethod method, MethodInformation methodInfo, boolean delegateToSuper, ClassMethod staticConstructor)
methodInfo - any JLR methoddelegateToSuper - protected static void invokeMethodHandler(ClassMethod method, MethodInformation methodInfo, boolean addReturnInstruction, BytecodeMethodResolver bytecodeMethodResolver, boolean addProceed, ClassMethod staticConstructor)
methodInfo - declaring class of the methodaddReturnInstruction - set to true you want to return the result ofbytecodeMethodResolver - The method resolveraddProceed - protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor)
addSpecialMethods in class ProxyFactory<T>proxyClassType - the Javassist class description for the proxy typepublic Class<?> getBeanType()
getBeanType in class ProxyFactory<T>protected boolean isCreatingProxy()
isCreatingProxy in class ProxyFactory<T>Copyright © 2014. All Rights Reserved.