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 |
---|---|
protected void |
addMethods(ClassFile proxyClassType) |
protected void |
addMethodsFromClass(ClassFile proxyClassType) |
protected void |
addSpecialMethods(ClassFile proxyClassType)
Adds methods requiring special implementations rather than just
delegation.
|
protected void |
createForwardingMethodBody(ClassMethod classMethod,
MethodInformation method) |
protected void |
createInterceptorBody(ClassMethod method,
MethodInformation methodInfo,
boolean delegateToSuper)
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)
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, setBeanInstance
public 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 interceptedprotected String getProxyNameSuffix()
getProxyNameSuffix
in class ProxyFactory<T>
protected void addMethods(ClassFile proxyClassType)
addMethods
in class ProxyFactory<T>
protected void addMethodsFromClass(ClassFile proxyClassType)
addMethodsFromClass
in class ProxyFactory<T>
protected void createForwardingMethodBody(ClassMethod classMethod, MethodInformation method)
createForwardingMethodBody
in class ProxyFactory<T>
protected void createInterceptorBody(ClassMethod method, MethodInformation methodInfo, boolean delegateToSuper)
methodInfo
- any JLR methoddelegateToSuper
- protected static void invokeMethodHandler(ClassMethod method, MethodInformation methodInfo, boolean addReturnInstruction, BytecodeMethodResolver bytecodeMethodResolver, boolean addProceed)
methodInfo
- declaring class of the methodaddReturnInstruction
- set to true you want to return the result ofbytecodeMethodResolver
- The method resolveraddProceed
- protected void addSpecialMethods(ClassFile proxyClassType)
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 © 2013 Seam Framework. All Rights Reserved.