public class NormalScopeProxyFactory extends AbstractProxyFactory
Provider.| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_INSTANCE_PROVIDER
the name of the field which stores the
Provider for the Contextual Instance |
static String |
FIELD_PROTECTED_METHODS
the Method[] for all protected methods.
|
FIELD_BEAN_PASSIVATION_ID, MAX_CLASSLOAD_TRIES, webBeansContext| Constructor and Description |
|---|
NormalScopeProxyFactory(WebBeansContext webBeansContext) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createConstructor(org.apache.xbean.asm4.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName)
Each of our interceptor/decorator proxies has exactly 1 constructor
which invokes the super ct + sets the delegation field.
|
protected void |
createInstanceVariables(org.apache.xbean.asm4.ClassWriter cw,
Class<?> classToProxy,
String classFileName)
generate the bytecode for creating the instance variables of the class
|
<T> T |
createNormalScopeProxy(javax.enterprise.inject.spi.Bean<T> bean) |
<T> Class<T> |
createProxyClass(javax.enterprise.inject.spi.Bean<T> bean,
ClassLoader classLoader,
Class<T> classToProxy) |
<T> Class<T> |
createProxyClass(ClassLoader classLoader,
Class<T> classToProxy) |
<T> T |
createProxyInstance(Class<T> proxyClass,
javax.inject.Provider provider) |
protected void |
createSerialisation(org.apache.xbean.asm4.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName)
generate the bytecode for serialization.
|
protected void |
delegateInterceptedMethods(ClassLoader classLoader,
org.apache.xbean.asm4.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
Method[] interceptedMethods)
In the NormalScope proxying case this is used for all the protected methods
as they need to get invoked via reflection.
|
protected void |
delegateNonInterceptedMethods(ClassLoader classLoader,
org.apache.xbean.asm4.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
Method[] noninterceptedMethods)
generate the bytecode for invoking all non-intercepted methods
|
static Object |
delegateProtectedMethod(Method method,
Object instance,
Object[] params)
This method get invoked via generated ASM code.
|
javax.inject.Provider |
getInstanceProvider(ClassLoader classLoader,
javax.enterprise.inject.spi.Bean<?> bean) |
javax.inject.Provider |
getInstanceProvider(OwbNormalScopeProxy proxyInstance) |
protected Class |
getMarkerInterface() |
static <T> T |
unwrapInstance(T proxyInstance) |
createArrayDefinition, createProxyClass, fixPreservedPackages, generateReturn, getCastType, getPrimitiveMethod, getReturnInsn, getUnusedProxyClassName, getVarInsn, getWrapperType, pushIntOntoStack, pushMethodParameterArray, unproxyableMethod, unsafeNewInstancepublic static final String FIELD_INSTANCE_PROVIDER
Provider for the Contextual Instancepublic static final String FIELD_PROTECTED_METHODS
public NormalScopeProxyFactory(WebBeansContext webBeansContext)
protected Class getMarkerInterface()
getMarkerInterface in class AbstractProxyFactorypublic static <T> T unwrapInstance(T proxyInstance)
public javax.inject.Provider getInstanceProvider(OwbNormalScopeProxy proxyInstance)
public <T> T createNormalScopeProxy(javax.enterprise.inject.spi.Bean<T> bean)
public javax.inject.Provider getInstanceProvider(ClassLoader classLoader, javax.enterprise.inject.spi.Bean<?> bean)
public <T> Class<T> createProxyClass(javax.enterprise.inject.spi.Bean<T> bean, ClassLoader classLoader, Class<T> classToProxy)
protected void createSerialisation(org.apache.xbean.asm4.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName)
AbstractProxyFactorycreateSerialisation in class AbstractProxyFactorypublic <T> Class<T> createProxyClass(ClassLoader classLoader, Class<T> classToProxy) throws ProxyGenerationException
T - classLoader - to use for creating the class inclassToProxy - the class for which a subclass will get generatedProxyGenerationExceptionpublic <T> T createProxyInstance(Class<T> proxyClass, javax.inject.Provider provider) throws ProxyGenerationException
ProxyGenerationExceptionprotected void createConstructor(org.apache.xbean.asm4.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName)
throws ProxyGenerationException
AbstractProxyFactorycreateConstructor in class AbstractProxyFactoryProxyGenerationExceptionprotected void createInstanceVariables(org.apache.xbean.asm4.ClassWriter cw,
Class<?> classToProxy,
String classFileName)
AbstractProxyFactorycreateInstanceVariables in class AbstractProxyFactoryprotected void delegateInterceptedMethods(ClassLoader classLoader, org.apache.xbean.asm4.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, Method[] interceptedMethods) throws ProxyGenerationException
delegateInterceptedMethods in class AbstractProxyFactoryProxyGenerationExceptionprotected void delegateNonInterceptedMethods(ClassLoader classLoader, org.apache.xbean.asm4.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, Method[] noninterceptedMethods) throws ProxyGenerationException
AbstractProxyFactorydelegateNonInterceptedMethods in class AbstractProxyFactoryProxyGenerationExceptionpublic static Object delegateProtectedMethod(Method method, Object instance, Object[] params)
Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.