|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.webbeans.proxy.AbstractProxyFactory
org.apache.webbeans.proxy.NormalScopeProxyFactory
public class NormalScopeProxyFactory
This factory creates proxies which delegate the
method invocations 1:1 to an instance which gets
resolved via a Provider.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.apache.webbeans.proxy.AbstractProxyFactory |
|---|
FIELD_BEAN_PASSIVATION_ID, MAX_CLASSLOAD_TRIES, MODIFIER_VARARGS, webBeansContext |
| Constructor Summary | |
|---|---|
NormalScopeProxyFactory(WebBeansContext webBeansContext)
|
|
| Method Summary | ||
|---|---|---|
protected void |
createConstructor(org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName,
Constructor<?> ignored)
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.asm5.ClassWriter cw,
Class<?> classToProxy,
String classFileName)
generate the bytecode for creating the instance variables of the class |
|
|
createNormalScopeProxy(javax.enterprise.inject.spi.Bean<T> bean)
|
|
|
createProxyClass(javax.enterprise.inject.spi.Bean<T> bean,
ClassLoader classLoader,
Class<T> classToProxy)
|
|
|
createProxyClass(ClassLoader classLoader,
Class<T> classToProxy)
|
|
|
createProxyInstance(Class<T> proxyClass,
javax.inject.Provider provider)
|
|
protected void |
createSerialisation(org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName)
generate the bytecode for serialization. |
|
protected void |
delegateInterceptedMethods(ClassLoader classLoader,
org.apache.xbean.asm5.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.asm5.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
|
unwrapInstance(T proxyInstance)
|
|
| Methods inherited from class org.apache.webbeans.proxy.AbstractProxyFactory |
|---|
createArrayDefinition, createProxyClass, createProxyClass, fixPreservedPackages, generateReturn, getCastType, getPrimitiveMethod, getProxyClassLoader, getReturnInsn, getUnusedProxyClassName, getVarInsn, getWrapperType, pushIntOntoStack, pushMethodParameterArray, unproxyableMethod, unsafeNewInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FIELD_INSTANCE_PROVIDER
Provider for the Contextual Instance
public static final String FIELD_PROTECTED_METHODS
| Constructor Detail |
|---|
public NormalScopeProxyFactory(WebBeansContext webBeansContext)
| Method Detail |
|---|
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.asm5.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 generated
ProxyGenerationException
public <T> T createProxyInstance(Class<T> proxyClass,
javax.inject.Provider provider)
throws ProxyGenerationException
ProxyGenerationException
protected void createConstructor(org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName,
Constructor<?> ignored)
throws ProxyGenerationException
AbstractProxyFactory
createConstructor in class AbstractProxyFactoryProxyGenerationException
protected void createInstanceVariables(org.apache.xbean.asm5.ClassWriter cw,
Class<?> classToProxy,
String classFileName)
AbstractProxyFactory
createInstanceVariables in class AbstractProxyFactory
protected void delegateInterceptedMethods(ClassLoader classLoader,
org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
Method[] interceptedMethods)
throws ProxyGenerationException
delegateInterceptedMethods in class AbstractProxyFactoryProxyGenerationException
protected void delegateNonInterceptedMethods(ClassLoader classLoader,
org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
Method[] noninterceptedMethods)
throws ProxyGenerationException
AbstractProxyFactory
delegateNonInterceptedMethods in class AbstractProxyFactoryProxyGenerationException
public static Object delegateProtectedMethod(Method method,
Object instance,
Object[] params)
generateDelegationMethod(org.apache.xbean.asm5.ClassWriter, java.lang.reflect.Method, int, Class, String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||