|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.webbeans.proxy.AbstractProxyFactory
public abstract class AbstractProxyFactory
Base class for all OWB Proxy factories
| Field Summary | |
|---|---|
static String |
FIELD_BEAN_PASSIVATION_ID
The name of the field which stores the passivationID of the Bean this proxy serves. |
static int |
MAX_CLASSLOAD_TRIES
|
static int |
MODIFIER_VARARGS
This is needed as the Modifier#VARARGS is not (yet) public. |
protected WebBeansContext |
webBeansContext
|
| Constructor Summary | |
|---|---|
protected |
AbstractProxyFactory(WebBeansContext webBeansContext)
|
| Method Summary | ||
|---|---|---|
protected void |
createArrayDefinition(org.apache.xbean.asm5.MethodVisitor mv,
int size,
Class<?> type)
pushes an array of the specified size to the method visitor. |
|
protected abstract void |
createConstructor(org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName,
Constructor<?> injectConstructor)
Each of our interceptor/decorator proxies has exactly 1 constructor which invokes the super ct + sets the delegation field. |
|
protected abstract void |
createInstanceVariables(org.apache.xbean.asm5.ClassWriter cw,
Class<?> classToProxy,
String classFileName)
generate the bytecode for creating the instance variables of the class |
|
protected
|
createProxyClass(ClassLoader classLoader,
String proxyClassName,
Class<T> classToProxy,
Method[] interceptedMethods,
Method[] nonInterceptedMethods)
|
|
protected
|
createProxyClass(ClassLoader classLoader,
String proxyClassName,
Class<T> classToProxy,
Method[] interceptedMethods,
Method[] nonInterceptedMethods,
Constructor<T> constructor)
|
|
protected abstract void |
createSerialisation(org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName)
generate the bytecode for serialization. |
|
protected abstract void |
delegateInterceptedMethods(ClassLoader classLoader,
org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
Method[] interceptedMethods)
generate the bytecode for invoking all intercepted methods |
|
protected abstract 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 |
|
protected String |
fixPreservedPackages(String proxyClassName)
|
|
protected void |
generateReturn(org.apache.xbean.asm5.MethodVisitor mv,
Method delegatedMethod)
|
|
protected String |
getCastType(Class<?> returnType)
Gets the string to use for CHECKCAST instruction, returning the correct value for any type, including primitives and arrays |
|
protected abstract Class |
getMarkerInterface()
|
|
protected String |
getPrimitiveMethod(Class<?> type)
Returns the name of the Java method to call to get the primitive value from an Object - e.g. intValue for java.lang.Integer |
|
protected ClassLoader |
getProxyClassLoader(Class<?> beanClass)
|
|
protected int |
getReturnInsn(Class<?> type)
Gets the appropriate bytecode instruction for RETURN, according to what type we need to return |
|
protected String |
getUnusedProxyClassName(ClassLoader classLoader,
String proxyClassName)
Detect a free classname based on the given one |
|
protected int |
getVarInsn(Class<?> type)
Returns the appropriate bytecode instruction to load a value from a variable to the stack |
|
protected String |
getWrapperType(Class<?> type)
|
|
protected void |
pushIntOntoStack(org.apache.xbean.asm5.MethodVisitor mv,
int i)
Invokes the most appropriate bytecode instruction to put a number on the stack |
|
protected void |
pushMethodParameterArray(org.apache.xbean.asm5.MethodVisitor mv,
Class<?>[] parameterTypes)
Create an Object[] parameter which contains all the parameters of the currently invoked method and store this array for use in the call stack. |
|
protected boolean |
unproxyableMethod(Method delegatedMethod)
|
|
protected
|
unsafeNewInstance(Class<T> clazz)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_CLASSLOAD_TRIES
public static final int MODIFIER_VARARGS
protected WebBeansContext webBeansContext
public static final String FIELD_BEAN_PASSIVATION_ID
| Constructor Detail |
|---|
protected AbstractProxyFactory(WebBeansContext webBeansContext)
| Method Detail |
|---|
protected ClassLoader getProxyClassLoader(Class<?> beanClass)
protected abstract Class getMarkerInterface()
protected abstract void createInstanceVariables(org.apache.xbean.asm5.ClassWriter cw,
Class<?> classToProxy,
String classFileName)
protected abstract void createSerialisation(org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName)
protected abstract void createConstructor(org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
String classFileName,
Constructor<?> injectConstructor)
throws ProxyGenerationException
cw - classToProxy - classFileName -
ProxyGenerationException
protected abstract void delegateInterceptedMethods(ClassLoader classLoader,
org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
Method[] interceptedMethods)
throws ProxyGenerationException
ProxyGenerationException
protected abstract void delegateNonInterceptedMethods(ClassLoader classLoader,
org.apache.xbean.asm5.ClassWriter cw,
String proxyClassFileName,
Class<?> classToProxy,
Method[] noninterceptedMethods)
throws ProxyGenerationException
ProxyGenerationException
protected String getUnusedProxyClassName(ClassLoader classLoader,
String proxyClassName)
proxyClassName -
protected String fixPreservedPackages(String proxyClassName)
protected <T> Class<T> createProxyClass(ClassLoader classLoader,
String proxyClassName,
Class<T> classToProxy,
Method[] interceptedMethods,
Method[] nonInterceptedMethods)
throws ProxyGenerationException
ProxyGenerationException
protected <T> Class<T> createProxyClass(ClassLoader classLoader,
String proxyClassName,
Class<T> classToProxy,
Method[] interceptedMethods,
Method[] nonInterceptedMethods,
Constructor<T> constructor)
throws ProxyGenerationException
T - classLoader - to use for creating the class inclassToProxy - the class for which a subclass will get generatedinterceptedMethods - the list of intercepted or decorated business methods.nonInterceptedMethods - all methods which are not intercepted nor decorated and shall get delegated directly
ProxyGenerationExceptionprotected boolean unproxyableMethod(Method delegatedMethod)
protected String getWrapperType(Class<?> type)
protected int getVarInsn(Class<?> type)
type - Type to load
protected void pushIntOntoStack(org.apache.xbean.asm5.MethodVisitor mv,
int i)
mv - i - protected int getReturnInsn(Class<?> type)
type - Type the needs to be returned
protected String getCastType(Class<?> returnType)
returnType - The type to cast to with CHECKCAST
protected String getPrimitiveMethod(Class<?> type)
type - Type whose primitive method we want to lookup
protected void generateReturn(org.apache.xbean.asm5.MethodVisitor mv,
Method delegatedMethod)
protected <T> T unsafeNewInstance(Class<T> clazz)
protected void pushMethodParameterArray(org.apache.xbean.asm5.MethodVisitor mv,
Class<?>[] parameterTypes)
mv - parameterTypes -
protected void createArrayDefinition(org.apache.xbean.asm5.MethodVisitor mv,
int size,
Class<?> type)
throws ProxyGenerationException
mv - MethodVisitor to usesize - Size of the array to createtype - Type of array to create
ProxyGenerationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||