org.apache.webbeans.proxy
Class SubclassProxyFactory

java.lang.Object
  extended by org.apache.webbeans.proxy.AbstractProxyFactory
      extended by 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, webBeansContext
 
Constructor Summary
SubclassProxyFactory(WebBeansContext webBeansContext)
           
 
Method Summary
protected  void createConstructor(org.apache.xbean.asm5.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, javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
           
protected  void createInstanceVariables(org.apache.xbean.asm5.ClassWriter cw, Class<?> classToProxy, String classFileName)
          generate the bytecode for creating the instance variables of the class
protected  void createSerialisation(org.apache.xbean.asm5.ClassWriter cw, String proxyClassFileName, Class<?> classToProxy, String classFileName)
          generate the bytecode for serialization.
<T> Class<T>
createSubClass(ClassLoader classLoader, javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
           
protected  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  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  Class getMarkerInterface()
           
 
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
 

Constructor Detail

SubclassProxyFactory

public SubclassProxyFactory(WebBeansContext webBeansContext)
Method Detail

getMarkerInterface

protected Class getMarkerInterface()
Specified by:
getMarkerInterface in class AbstractProxyFactory
Returns:
the marker interface which should be used for this proxy.

createImplementedSubclass

public <T> Class<T> createImplementedSubclass(ClassLoader classLoader,
                                              javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)

createSubClass

public <T> Class<T> createSubClass(ClassLoader classLoader,
                                   javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
                        throws ProxyGenerationException
Type Parameters:
T -
Parameters:
classLoader - to use for creating the class in
annotatedType - the annotatedType for which a subclass will get generated
Returns:
the proxy class
Throws:
ProxyGenerationException

createConstructor

protected void createConstructor(org.apache.xbean.asm5.ClassWriter cw,
                                 String proxyClassFileName,
                                 Class<?> classToProxy,
                                 String classFileName,
                                 Constructor<?> constructor)
                          throws ProxyGenerationException
Description copied from class: AbstractProxyFactory
Each of our interceptor/decorator proxies has exactly 1 constructor which invokes the super ct + sets the delegation field.

Specified by:
createConstructor in class AbstractProxyFactory
Throws:
ProxyGenerationException

createInstanceVariables

protected void createInstanceVariables(org.apache.xbean.asm5.ClassWriter cw,
                                       Class<?> classToProxy,
                                       String classFileName)
Description copied from class: AbstractProxyFactory
generate the bytecode for creating the instance variables of the class

Specified by:
createInstanceVariables in class AbstractProxyFactory

delegateInterceptedMethods

protected void delegateInterceptedMethods(ClassLoader classLoader,
                                          org.apache.xbean.asm5.ClassWriter cw,
                                          String proxyClassFileName,
                                          Class<?> classToProxy,
                                          Method[] interceptedMethods)
                                   throws ProxyGenerationException
Description copied from class: AbstractProxyFactory
generate the bytecode for invoking all intercepted methods

Specified by:
delegateInterceptedMethods in class AbstractProxyFactory
Throws:
ProxyGenerationException

createSerialisation

protected void createSerialisation(org.apache.xbean.asm5.ClassWriter cw,
                                   String proxyClassFileName,
                                   Class<?> classToProxy,
                                   String classFileName)
Description copied from class: AbstractProxyFactory
generate the bytecode for serialization.

Specified by:
createSerialisation in class AbstractProxyFactory

delegateNonInterceptedMethods

protected void delegateNonInterceptedMethods(ClassLoader classLoader,
                                             org.apache.xbean.asm5.ClassWriter cw,
                                             String proxyClassFileName,
                                             Class<?> classToProxy,
                                             Method[] noninterceptedMethods)
                                      throws ProxyGenerationException
Description copied from class: AbstractProxyFactory
generate the bytecode for invoking all non-intercepted methods

Specified by:
delegateNonInterceptedMethods in class AbstractProxyFactory
Throws:
ProxyGenerationException


Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.