Package org.apache.webbeans.proxy
Class SubclassProxyFactory
- java.lang.Object
-
- org.apache.webbeans.proxy.AbstractProxyFactory
-
- org.apache.webbeans.proxy.SubclassProxyFactory
-
public class SubclassProxyFactory extends AbstractProxyFactory
This factory creates subclasses for abstract classes. This is being used for Abstract Decorators.
-
-
Field Summary
-
Fields inherited from class org.apache.webbeans.proxy.AbstractProxyFactory
FIELD_BEAN_PASSIVATION_ID, MAX_CLASSLOAD_TRIES, MODIFIER_VARARGS, unsafe, webBeansContext
-
-
Constructor Summary
Constructors Constructor Description SubclassProxyFactory(WebBeansContext webBeansContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateConstructor(org.apache.xbean.asm9.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, String classFileName, Constructor<?> constructor)Each of our interceptor/decorator proxies has exactly 1 constructor which invokes the super ct + sets the delegation field.<T> Class<T>createImplementedSubclass(ClassLoader classLoader, jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType)protected voidcreateInstanceVariables(org.apache.xbean.asm9.ClassWriter cw, Class<?> classToProxy, String classFileName)generate the bytecode for creating the instance variables of the classprotected voidcreateSerialisation(org.apache.xbean.asm9.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, String classFileName)generate the bytecode for serialization.<T> Class<T>createSubClass(ClassLoader classLoader, jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType)protected voiddelegateInterceptedMethods(ClassLoader classLoader, org.apache.xbean.asm9.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, Method[] interceptedMethods)generate the bytecode for invoking all intercepted methodsprotected voiddelegateNonInterceptedMethods(ClassLoader classLoader, org.apache.xbean.asm9.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, Method[] noninterceptedMethods)generate the bytecode for invoking all non-intercepted methodsprotected ClassgetMarkerInterface()-
Methods inherited from class org.apache.webbeans.proxy.AbstractProxyFactory
createArrayDefinition, createProxyClass, createProxyClass, fixPreservedPackages, generateReturn, getCastType, getPrimitiveMethod, getProxyClassLoader, getReturnInsn, getSignedClassProxyName, getUnusedProxyClassName, getUnusedProxyClassName, getVarInsn, getWrapperType, newInstance, pushIntOntoStack, pushMethodParameterArray, uniqueHash, unproxyableMethod
-
-
-
-
Constructor Detail
-
SubclassProxyFactory
public SubclassProxyFactory(WebBeansContext webBeansContext)
-
-
Method Detail
-
getMarkerInterface
protected Class getMarkerInterface()
- Specified by:
getMarkerInterfacein classAbstractProxyFactory- Returns:
- the marker interface which should be used for this proxy.
-
createImplementedSubclass
public <T> Class<T> createImplementedSubclass(ClassLoader classLoader, jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType)
-
createSubClass
public <T> Class<T> createSubClass(ClassLoader classLoader, jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType) throws ProxyGenerationException
- Type Parameters:
T-- Parameters:
classLoader- to use for creating the class inannotatedType- the annotatedType for which a subclass will get generated- Returns:
- the proxy class
- Throws:
ProxyGenerationException
-
createConstructor
protected void createConstructor(org.apache.xbean.asm9.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, String classFileName, Constructor<?> constructor) throws ProxyGenerationExceptionDescription copied from class:AbstractProxyFactoryEach of our interceptor/decorator proxies has exactly 1 constructor which invokes the super ct + sets the delegation field.- Specified by:
createConstructorin classAbstractProxyFactory- Throws:
ProxyGenerationException
-
createInstanceVariables
protected void createInstanceVariables(org.apache.xbean.asm9.ClassWriter cw, Class<?> classToProxy, String classFileName)Description copied from class:AbstractProxyFactorygenerate the bytecode for creating the instance variables of the class- Specified by:
createInstanceVariablesin classAbstractProxyFactory
-
delegateInterceptedMethods
protected void delegateInterceptedMethods(ClassLoader classLoader, org.apache.xbean.asm9.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, Method[] interceptedMethods) throws ProxyGenerationException
Description copied from class:AbstractProxyFactorygenerate the bytecode for invoking all intercepted methods- Specified by:
delegateInterceptedMethodsin classAbstractProxyFactory- Throws:
ProxyGenerationException
-
createSerialisation
protected void createSerialisation(org.apache.xbean.asm9.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, String classFileName)Description copied from class:AbstractProxyFactorygenerate the bytecode for serialization.- Specified by:
createSerialisationin classAbstractProxyFactory
-
delegateNonInterceptedMethods
protected void delegateNonInterceptedMethods(ClassLoader classLoader, org.apache.xbean.asm9.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, Method[] noninterceptedMethods) throws ProxyGenerationException
Description copied from class:AbstractProxyFactorygenerate the bytecode for invoking all non-intercepted methods- Specified by:
delegateNonInterceptedMethodsin classAbstractProxyFactory- Throws:
ProxyGenerationException
-
-