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, MODIFIER_VARARGS, webBeansContext
Constructor and Description |
---|
NormalScopeProxyFactory(WebBeansContext webBeansContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
createConstructor(org.objectweb.asm.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.objectweb.asm.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.objectweb.asm.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName)
generate the bytecode for serialization.
|
protected void |
delegateInterceptedMethods(ClassLoader classLoader,
org.objectweb.asm.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.objectweb.asm.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, getProxyClassLoader, getReturnInsn, getUnusedProxyClassName, getVarInsn, getWrapperType, pushIntOntoStack, pushMethodParameterArray, unproxyableMethod, unsafeNewInstance
public 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 AbstractProxyFactory
public 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.objectweb.asm.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, String classFileName)
AbstractProxyFactory
createSerialisation
in class AbstractProxyFactory
public <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 generatedProxyGenerationException
public <T> T createProxyInstance(Class<T> proxyClass, javax.inject.Provider provider) throws ProxyGenerationException
ProxyGenerationException
protected void createConstructor(org.objectweb.asm.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, String classFileName) throws ProxyGenerationException
AbstractProxyFactory
createConstructor
in class AbstractProxyFactory
ProxyGenerationException
protected void createInstanceVariables(org.objectweb.asm.ClassWriter cw, Class<?> classToProxy, String classFileName)
AbstractProxyFactory
createInstanceVariables
in class AbstractProxyFactory
protected void delegateInterceptedMethods(ClassLoader classLoader, org.objectweb.asm.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, Method[] interceptedMethods) throws ProxyGenerationException
delegateInterceptedMethods
in class AbstractProxyFactory
ProxyGenerationException
protected void delegateNonInterceptedMethods(ClassLoader classLoader, org.objectweb.asm.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, Method[] noninterceptedMethods) throws ProxyGenerationException
AbstractProxyFactory
delegateNonInterceptedMethods
in class AbstractProxyFactory
ProxyGenerationException
public static Object delegateProtectedMethod(Method method, Object instance, Object[] params)
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.