openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1432598 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: decorator/ intercept/ portable/events/discovery/
Date Sun, 13 Jan 2013 12:11:57 GMT
Author: struberg
Date: Sun Jan 13 12:11:56 2013
New Revision: 1432598

URL: http://svn.apache.org/viewvc?rev=1432598&view=rev
Log:
OWB-344 manage cdi interceptors inside the InterceptorsManager

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java?rev=1432598&r1=1432597&r2=1432598&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
Sun Jan 13 12:11:56 2013
@@ -56,7 +56,7 @@ import java.util.logging.Level;
 /**
  * Defines decorators. It wraps the bean instance related
  * with decorator class. Actually, each decorator is an instance
- * of the {@link ManagedBean}.
+ * of the {@link Bean}.
  * 
  * @version $Rev$ $Date$
  *

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java?rev=1432598&r1=1432597&r2=1432598&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java
Sun Jan 13 12:11:56 2013
@@ -30,6 +30,7 @@ import java.util.concurrent.CopyOnWriteA
 
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Interceptor;
+import javax.enterprise.inject.spi.PassivationCapable;
 
 import org.apache.webbeans.component.OwbBean;
 import org.apache.webbeans.config.WebBeansContext;
@@ -51,9 +52,9 @@ public class InterceptorsManager
     private List<Class<?>> configuredInterceptorClasses = new CopyOnWriteArrayList<Class<?>>();
 
     /**
-     * Active interceptors
+     * Active CDI-style interceptors.
      */
-    private List<Interceptor<?>> webBeansInterceptors = new ArrayList<Interceptor<?>>();
+    private List<Interceptor<?>> cdiInterceptors = new ArrayList<Interceptor<?>>();
 
     /**Additional interceptor class*/
     private List<Class<?>> additionalInterceptorClasses = new ArrayList<Class<?>>();
@@ -142,10 +143,15 @@ public class InterceptorsManager
     }
 
 
-    public void addInterceptor(Interceptor interceptor)
+    /**
+     * Add a CDI-style interceptor.
+     * These are interceptors declared using an {@link javax.interceptor.InterceptorBinding}.
+     * @param interceptor
+     */
+    public void addCdiInterceptor(Interceptor interceptor)
     {
-        webBeansInterceptors.add(interceptor);
-        if (interceptor instanceof OwbBean)
+        cdiInterceptors.add(interceptor);
+        if (interceptor instanceof PassivationCapable)
         {
             OwbBean<?> owbBean = (OwbBean<?>)interceptor;
             if(owbBean.isPassivationCapable())
@@ -159,7 +165,7 @@ public class InterceptorsManager
 
     public List<Interceptor<?>> getInterceptors()
     {
-        return webBeansInterceptors;
+        return cdiInterceptors;
     }
 
     public void addCustomInterceptorClass(Class<?> clazz)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java?rev=1432598&r1=1432597&r2=1432598&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
Sun Jan 13 12:11:56 2013
@@ -167,7 +167,7 @@ public final class WebBeansInterceptorCo
         }
 
 
-        delegate.getWebBeansContext().getInterceptorsManager().addInterceptor(interceptor);
+        delegate.getWebBeansContext().getInterceptorsManager().addCdiInterceptor(interceptor);
 
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java?rev=1432598&r1=1432597&r2=1432598&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java
Sun Jan 13 12:11:56 2013
@@ -107,7 +107,7 @@ public class AfterBeanDiscoveryImpl impl
             }
 
             InterceptorsManager interceptorsManager = webBeansContext.getInterceptorsManager();
-            interceptorsManager.addInterceptor(interceptor);
+            interceptorsManager.addCdiInterceptor(interceptor);
             interceptorsManager.addCustomInterceptorClass(bean.getBeanClass());
         }
         



Mime
View raw message