openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1434505 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: config/BeansDeployer.java config/WebBeansContext.java intercept/WebBeansInterceptorConfig.java
Date Wed, 16 Jan 2013 23:50:04 GMT
Author: struberg
Date: Wed Jan 16 23:50:03 2013
New Revision: 1434505

URL: http://svn.apache.org/viewvc?rev=1434505&view=rev
Log:
OWB-344 remove old way of defining Interceptors pt1

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java

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=1434505&r1=1434504&r2=1434505&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
Wed Jan 16 23:50:03 2013
@@ -875,33 +875,17 @@ public class BeansDeployer
                     logger.log(Level.FINE, "Found Managed Bean Interceptor with class name
: [{0}]", annotatedType.getJavaClass().getName());
                 }
                 
-                if (WebBeansContext.TODO_USING_NEW_INTERCEPTORS)
+                CdiInterceptorBeanBuilder<T> ibb = new CdiInterceptorBeanBuilder<T>(webBeansContext,
annotatedType);
+                if (ibb.isInterceptorEnabled())
                 {
-                    CdiInterceptorBeanBuilder<T> ibb
-                    = new CdiInterceptorBeanBuilder<T>(webBeansContext, annotatedType);
-                    if (ibb.isInterceptorEnabled())
-                    {
-                        ibb.defineCdiInterceptorRules();
-                        CdiInterceptorBean<T> interceptor = ibb.getBean();
-                        webBeansContext.getInterceptorsManager().addCdiInterceptor(interceptor);
-                        bean = interceptor;
-                    }
-                    else
-                    {
-                        bean = null;
-                    }
-                    
+                    ibb.defineCdiInterceptorRules();
+                    CdiInterceptorBean<T> interceptor = ibb.getBean();
+                    webBeansContext.getInterceptorsManager().addCdiInterceptor(interceptor);
+                    bean = interceptor;
                 }
                 else
                 {
-                    if(annotationTypeSet)
-                    {
-                        bean = webBeansContext.getWebBeansUtil().defineInterceptor(annotatedType);
-                    }
-                    else
-                    {
-                        bean = managedBeanCreator.defineInterceptor(annotatedType);
-                    }
+                    bean = null;
                 }
             }
             else

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java?rev=1434505&r1=1434504&r2=1434505&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
Wed Jan 16 23:50:03 2013
@@ -64,9 +64,6 @@ import org.apache.webbeans.util.WebBeans
  */
 public class WebBeansContext
 {
-    //X TODO REMOVE, only used while implementing the new Interceptor handling
-    public static final boolean TODO_USING_NEW_INTERCEPTORS = true;
-
     private final Map<Class<?>, Object> managerMap = new HashMap<Class<?>,
Object>();
 
     private final Map<Class<?>, Object> serviceMap = new HashMap<Class<?>,
Object>();

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=1434505&r1=1434504&r2=1434505&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
Wed Jan 16 23:50:03 2013
@@ -20,7 +20,6 @@ package org.apache.webbeans.intercept;
 
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.component.InjectionTargetBean;
-import org.apache.webbeans.component.EnterpriseBeanMarker;
 import org.apache.webbeans.component.InterceptedMarker;
 import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.config.WebBeansContext;
@@ -32,10 +31,8 @@ import org.apache.webbeans.portable.Inje
 import org.apache.webbeans.proxy.InterceptorDecoratorProxyFactory;
 import org.apache.webbeans.spi.BDABeansXmlScanner;
 import org.apache.webbeans.spi.ScannerService;
-import org.apache.webbeans.spi.plugins.OpenWebBeansEjbPlugin;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ArrayUtil;
-import org.apache.webbeans.util.Asserts;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
@@ -90,12 +87,6 @@ public final class WebBeansInterceptorCo
      */
     public void defineBeanInterceptorStack(InjectionTargetBean<?> bean)
     {
-        if (!WebBeansContext.TODO_USING_NEW_INTERCEPTORS)
-        {
-            defineBeanInterceptorStackRemove(bean);
-            return;
-        }
-
         if (bean instanceof InterceptedMarker)
         {
             InjectionTargetImpl<?> injectionTarget = (InjectionTargetImpl<?>)
bean.getInjectionTarget();
@@ -196,55 +187,6 @@ public final class WebBeansInterceptorCo
         return lifecycleInterceptors;
     }
 
-    /**
-     * Configure bean instance interceptor stack.
-     * @param bean bean instance
-     * @deprecated old InterceptorData based config
-     */
-    public void defineBeanInterceptorStackRemove(InjectionTargetBean<?> bean)
-    {
-
-        Asserts.assertNotNull(bean, "bean parameter can no be null");
-        if (!bean.getInterceptorStack().isEmpty())
-        {
-            // the interceptorstack already got defined!
-            return;
-        }
-
-        // If bean is not session bean
-        if(!(bean instanceof EnterpriseBeanMarker))
-        {
-            bean.getWebBeansContext().getEJBInterceptorConfig().configure(bean.getAnnotatedType(),
bean.getInterceptorStack());
-        }
-        else
-        {
-            //Check for injected fields in EJB @Interceptors
-            List<InterceptorData> stack = new ArrayList<InterceptorData>();
-            bean.getWebBeansContext().getEJBInterceptorConfig().configure(bean.getAnnotatedType(),
stack);
-
-            final OpenWebBeansEjbPlugin ejbPlugin = bean.getWebBeansContext().getPluginLoader().getEjbPlugin();
-            final boolean isStateful = ejbPlugin != null && ejbPlugin.isStatefulBean(bean.getBeanClass());
-
-            if (isStateful)
-            {
-                for (InterceptorData data : stack)
-                {
-                    if (data.isDefinedInInterceptorClass())
-                    {
-                        AnnotationManager annotationManager = bean.getWebBeansContext().getAnnotationManager();
-                        if (!annotationManager.checkInjectionPointForInterceptorPassivation(data.getInterceptorClass()))
-                        {
-                            throw new WebBeansConfigurationException("Enterprise bean : "
+ bean.toString() +
-                                    " interceptors must have serializable injection points");
-                        }
-                    }
-                }
-            }
-        }
-
-        // For every injection target bean
-        configure(bean, bean.getInterceptorStack());
-    }
 
     /**
      * Configures WebBeans specific interceptor class.



Mime
View raw message