openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1606529 - in /openwebbeans/trunk: webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/ webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ webbeans-impl/src/main/java/org/apache/webbeans/component/ webbeans-impl/src/ma...
Date Sun, 29 Jun 2014 15:58:52 GMT
Author: rmannibucau
Date: Sun Jun 29 15:58:52 2014
New Revision: 1606529

URL: http://svn.apache.org/r1606529
Log:
decoration of InjectionPoint

Modified:
    openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanMetadataBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuiltInOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/DecoratorMetadataBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventMetadataBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptedOrDecoratedBeanMetadataBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptorMetadataBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/trunk/webbeans-tck/testng-dev.xml

Modified: openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java
(original)
+++ openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java
Sun Jun 29 15:58:52 2014
@@ -43,5 +43,10 @@ public class PrincipalBean extends Built
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java
(original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java
Sun Jun 29 15:58:52 2014
@@ -43,5 +43,11 @@ public class UserTransactionBean extends
     public boolean isPassivationCapable()
     {
         return true;
-    }    
+    }
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java
(original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java
Sun Jun 29 15:58:52 2014
@@ -43,5 +43,10 @@ public class ValidatorBean extends Built
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java
(original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java
Sun Jun 29 15:58:52 2014
@@ -43,5 +43,11 @@ public class ValidatorFactoryBean extend
     public boolean isPassivationCapable()
     {
         return true;
-    }    
+    }
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java
Sun Jun 29 15:58:52 2014
@@ -23,6 +23,7 @@ import java.lang.reflect.Type;
 import javax.enterprise.inject.spi.BeanManager;
 
 import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.portable.BeanManagerProducer;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.CollectionUtil;
@@ -46,5 +47,11 @@ public class BeanManagerBean extends Bui
     public boolean isPassivationCapable()
     {
         return true;
-    }    
+    }
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return BeanManagerImpl.class;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanMetadataBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanMetadataBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanMetadataBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanMetadataBean.java
Sun Jun 29 15:58:52 2014
@@ -55,5 +55,10 @@ public class BeanMetadataBean<T> extends
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuiltInOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuiltInOwbBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuiltInOwbBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuiltInOwbBean.java
Sun Jun 29 15:58:52 2014
@@ -56,4 +56,9 @@ public abstract class BuiltInOwbBean<T> 
     {
         return producer;
     }
+
+    /**
+     * @return some built in beans can be decorated, this class is the one used to generate
the proxy
+     */
+    public abstract Class<?> proxyableType();
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java
Sun Jun 29 15:58:52 2014
@@ -61,4 +61,10 @@ public class ConversationBean extends Bu
                       new ConversationProducer(webBeansContext.getAnnotatedElementFactory().newAnnotatedType(ConversationImpl.class),
webBeansContext)));
         setEnabled(true);
     }
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return ConversationImpl.class;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/DecoratorMetadataBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/DecoratorMetadataBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/DecoratorMetadataBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/DecoratorMetadataBean.java
Sun Jun 29 15:58:52 2014
@@ -54,5 +54,10 @@ public class DecoratorMetadataBean<T> ex
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java
Sun Jun 29 15:58:52 2014
@@ -24,6 +24,7 @@ import javax.enterprise.event.Event;
 import javax.enterprise.util.TypeLiteral;
 
 import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.event.EventImpl;
 import org.apache.webbeans.portable.EventProducer;
 import org.apache.webbeans.util.CollectionUtil;
 
@@ -58,5 +59,10 @@ public class EventBean<T> extends BuiltI
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return EventImpl.class;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventMetadataBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventMetadataBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventMetadataBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventMetadataBean.java
Sun Jun 29 15:58:52 2014
@@ -52,5 +52,10 @@ public class EventMetadataBean extends B
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null; // not using AbstractProducer
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java
Sun Jun 29 15:58:52 2014
@@ -50,4 +50,10 @@ public class ExtensionBean<T> extends Bu
                 false,
                 new ExtensionProducerFactory<T>(webBeansContext.getAnnotatedElementFactory().getAnnotatedType(returnType),
webBeansContext));
     }
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java
Sun Jun 29 15:58:52 2014
@@ -28,6 +28,18 @@ import org.apache.webbeans.util.Collecti
 
 public class InjectionPointBean extends BuiltInOwbBean<InjectionPoint>
 {
+    private static final Class<?> PROXY_CLASS;
+    static
+    {
+        try
+        {
+            PROXY_CLASS = BuiltInOwbBean.class.getClassLoader().loadClass("org.apache.webbeans.inject.impl.InjectionPointImpl");
+        }
+        catch (final ClassNotFoundException e)
+        {
+            throw new IllegalStateException(e);
+        }
+    }
     public InjectionPointBean(WebBeansContext webBeansContext)
     {
         super(webBeansContext,
@@ -46,5 +58,10 @@ public class InjectionPointBean extends 
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return PROXY_CLASS;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java
Sun Jun 29 15:58:52 2014
@@ -25,6 +25,7 @@ import javax.enterprise.util.TypeLiteral
 import javax.inject.Provider;
 
 import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.inject.instance.InstanceImpl;
 import org.apache.webbeans.portable.InstanceProducer;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.CollectionUtil;
@@ -56,4 +57,9 @@ public class InstanceBean<T> extends Bui
         return true;
     }
 
+    @Override
+    public Class<?> proxyableType()
+    {
+        return InstanceImpl.class;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptedOrDecoratedBeanMetadataBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptedOrDecoratedBeanMetadataBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptedOrDecoratedBeanMetadataBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptedOrDecoratedBeanMetadataBean.java
Sun Jun 29 15:58:52 2014
@@ -61,5 +61,10 @@ public class InterceptedOrDecoratedBeanM
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptorMetadataBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptorMetadataBean.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptorMetadataBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InterceptorMetadataBean.java
Sun Jun 29 15:58:52 2014
@@ -54,5 +54,10 @@ public class InterceptorMetadataBean<T> 
     {
         return true;
     }
-    
+
+    @Override
+    public Class<?> proxyableType()
+    {
+        return null;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Sun Jun 29 15:58:52 2014
@@ -20,6 +20,7 @@ package org.apache.webbeans.config;
 
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.component.AbstractProducerBean;
+import org.apache.webbeans.component.BuiltInOwbBean;
 import org.apache.webbeans.component.CdiInterceptorBean;
 import org.apache.webbeans.component.DecoratorBean;
 import org.apache.webbeans.component.EnterpriseBeanMarker;
@@ -569,6 +570,16 @@ public class BeansDeployer
                 //don't validate the cdi-api
                 if (bean.getBeanClass().getName().startsWith(JAVAX_ENTERPRISE_PACKAGE))
                 {
+                    if (BuiltInOwbBean.class.isInstance(bean))
+                    {
+                        final Class<?> proxyable = BuiltInOwbBean.class.cast(bean).proxyableType();
+                        if (proxyable != null)
+                        {
+                            final AbstractProducer producer = AbstractProducer.class.cast(OwbBean.class.cast(bean).getProducer());
+                            final AnnotatedType<?> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(proxyable);
+                            producer.defineInterceptorStack(bean, annotatedType, webBeansContext);
+                        }
+                    }
                     continue;
                 }
 

Modified: openwebbeans/trunk/webbeans-tck/testng-dev.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tck/testng-dev.xml?rev=1606529&r1=1606528&r2=1606529&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tck/testng-dev.xml (original)
+++ openwebbeans/trunk/webbeans-tck/testng-dev.xml Sun Jun 29 15:58:52 2014
@@ -19,7 +19,7 @@
   <test name="JSR-346 TCK">
     <classes>
       <class
-          name="org.jboss.cdi.tck.tests.lookup.dynamic.destroy.normal.DestroyingNormalScopedInstanceTest"/>
+          name="org.jboss.cdi.tck.tests.decorators.builtin.injectionpoint.BuiltinInjectionPointDecoratorTest"/>
     </classes>
     <groups>
       <run>



Mime
View raw message