org.apache.webbeans.proxy
Class JavassistProxyFactory

java.lang.Object
  extended by org.apache.webbeans.proxy.JavassistProxyFactory

public final class JavassistProxyFactory
extends Object


Constructor Summary
JavassistProxyFactory()
           
 
Method Summary
 void clear()
           
 Class<?> createAbstractDecoratorProxyClass(OwbBean<?> bean)
           
 Object createDependentScopedBeanProxy(OwbBean<?> bean, Object actualInstance, CreationalContext<?> creastionalContext)
           
static WebBeansAnnotation createNewAnnotationProxy(Class<? extends Annotation> annotationType)
           
 Object createNormalScopedBeanProxy(OwbBean<?> bean, CreationalContext<?> creationalContext)
           
 javassist.util.proxy.ProxyFactory createProxyFactory(Bean<?> bean)
           
 Class<?> defineEjbBeanProxyClass(OwbBean<?> bean, Class<?> iface, javassist.util.proxy.ProxyFactory factory)
          Defines the proxy for the given bean and iface using callers factory.
 Class<?> getEjbBeanProxyClass(OwbBean<?> bean, Class<?> iface)
          Provides the proxy for the given bean and interface, if defined
static JavassistProxyFactory getInstance()
           
 Map<OwbBean<?>,Class<?>> getInterceptorProxyClasses()
           
 Class<?> getProxyClass(javassist.util.proxy.ProxyFactory factory)
           
static boolean isProxyInstance(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavassistProxyFactory

public JavassistProxyFactory()
Method Detail

getInterceptorProxyClasses

public Map<OwbBean<?>,Class<?>> getInterceptorProxyClasses()

getInstance

public static JavassistProxyFactory getInstance()

clear

public void clear()

getEjbBeanProxyClass

public Class<?> getEjbBeanProxyClass(OwbBean<?> bean,
                                     Class<?> iface)
Provides the proxy for the given bean and interface, if defined

Parameters:
bean - the contextual representing the EJB
iface - the injected business local interface
Returns:
the proxy Class if one has been defined, else null

defineEjbBeanProxyClass

public Class<?> defineEjbBeanProxyClass(OwbBean<?> bean,
                                        Class<?> iface,
                                        javassist.util.proxy.ProxyFactory factory)
Defines the proxy for the given bean and iface using callers factory. Due to races with the concurrentmap, this might sometimes create additional javassist-defined classes that are not used by the caller and not stored in the map. Synchronizing the entire method, and getEjbBeanProxyClass, on ejbProxyClasses is an alternative.

Parameters:
bean - the contextual representing the EJB
iface - the injected business local interface
factory -
Returns:

createAbstractDecoratorProxyClass

public Class<?> createAbstractDecoratorProxyClass(OwbBean<?> bean)

createNormalScopedBeanProxy

public Object createNormalScopedBeanProxy(OwbBean<?> bean,
                                          CreationalContext<?> creationalContext)

createDependentScopedBeanProxy

public Object createDependentScopedBeanProxy(OwbBean<?> bean,
                                             Object actualInstance,
                                             CreationalContext<?> creastionalContext)

getProxyClass

public Class<?> getProxyClass(javassist.util.proxy.ProxyFactory factory)

createProxyFactory

public javassist.util.proxy.ProxyFactory createProxyFactory(Bean<?> bean)
                                                     throws Exception
Throws:
Exception

createNewAnnotationProxy

public static WebBeansAnnotation createNewAnnotationProxy(Class<? extends Annotation> annotationType)

isProxyInstance

public static boolean isProxyInstance(Object o)
Parameters:
o - the object to check
Returns:
true if the given object is a proxy


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.