openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1429566 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: config/BeansDeployer.java container/BeanManagerImpl.java decorator/DecoratorsManager.java portable/events/discovery/AfterBeanDiscoveryImpl.java
Date Sun, 06 Jan 2013 18:45:02 GMT
Author: struberg
Date: Sun Jan  6 18:45:02 2013
New Revision: 1429566

URL: http://svn.apache.org/viewvc?rev=1429566&view=rev
Log:
OWB-344 move Decorator information from BeanManager to DecoratorsManager (pt 1)

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.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/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1429566&r1=1429565&r2=1429566&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 Jan  6 18:45:02 2013
@@ -428,7 +428,7 @@ public class BeansDeployer
                         else
                         {
                             if(!bean.getBeanClass().isAnnotationPresent(javax.decorator.Decorator.class)
-                                    && !webBeansContext.getBeanManagerImpl().containsCustomDecoratorClass(bean.getBeanClass()))
+                                    && !webBeansContext.getDecoratorsManager().containsCustomDecoratorClass(bean.getBeanClass()))
                             {
                                 throw new WebBeansConfigurationException(
                                         "Delegate injection points can not defined by beans
that are not decorator. Injection point : "
@@ -879,7 +879,7 @@ public class BeansDeployer
             }
             else
             {
-                if (webBeansContext.getBeanManagerImpl().containsCustomDecoratorClass(annotatedType.getJavaClass())
||
+                if (webBeansContext.getDecoratorsManager().containsCustomDecoratorClass(annotatedType.getJavaClass())
||
                     webBeansContext.getInterceptorsManager().containsCustomInterceptorClass(annotatedType.getJavaClass()))
                 {
                     return false;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=1429566&r1=1429565&r2=1429566&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Sun Jan  6 18:45:02 2013
@@ -145,8 +145,6 @@ public class BeanManagerImpl implements 
     /**XML configurator instance*/
     private WebBeansXMLConfigurator xmlConfigurator = null;
     
-    /**Additional decorator class*/
-    private List<Class<?>> additionalDecoratorClasses = new ArrayList<Class<?>>();
 
     /**
      * This list contains additional qualifiers which got set via the
@@ -387,18 +385,6 @@ public class BeanManagerImpl implements 
 
     }
 
-    public void addCustomDecoratorClass(Class<?> clazz)
-    {
-        Asserts.nullCheckForClass(clazz);
-        additionalDecoratorClasses.add(clazz);
-    }
-
-    public boolean containsCustomDecoratorClass(Class<?> clazz)
-    {
-        Asserts.nullCheckForClass(clazz);
-        return additionalDecoratorClasses.contains(clazz);
-    }
-
     /**
      * {@inheritDoc}
      */
@@ -1015,7 +1001,6 @@ public class BeanManagerImpl implements 
     public void clear()
     {
         additionalAnnotatedTypes.clear();
-        additionalDecoratorClasses.clear();
         additionalQualifiers.clear();
         additionalScopes.clear();
         clearCacheProxies();
@@ -1027,6 +1012,7 @@ public class BeanManagerImpl implements 
         passivationBeans.clear();
         webBeansDecorators.clear();
         webBeansContext.getInterceptorsManager().clear();
+        webBeansContext.getDecoratorsManager().clear();
     }
 
     public void clearCacheProxies()

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java?rev=1429566&r1=1429565&r2=1429566&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java
Sun Jan  6 18:45:02 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.webbeans.decorator;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
@@ -33,6 +34,10 @@ public class DecoratorsManager
     private List<Class<?>> enabledDecorators = new CopyOnWriteArrayList<Class<?>>();
     private final BeanManagerImpl manager;
 
+    /**Additional decorator class*/
+    private List<Class<?>> additionalDecoratorClasses = new ArrayList<Class<?>>();
+
+
     public DecoratorsManager(WebBeansContext webBeansContext)
     {
         manager = webBeansContext.getBeanManagerImpl();
@@ -87,11 +92,28 @@ public class DecoratorsManager
         for(Class<?> decoratorClazz : enabledDecorators)
         {
             //Validate decorator classes
-            if(!decoratorClazz.isAnnotationPresent(Decorator.class) && !manager.containsCustomDecoratorClass(decoratorClazz))
+            if(!decoratorClazz.isAnnotationPresent(Decorator.class) && !containsCustomDecoratorClass(decoratorClazz))
             {
                 throw new WebBeansConfigurationException("Given class : " + decoratorClazz
+ " is not a decorator class");
             }   
         }                
     }
 
+
+    public void addCustomDecoratorClass(Class<?> clazz)
+    {
+        Asserts.nullCheckForClass(clazz);
+        additionalDecoratorClasses.add(clazz);
+    }
+
+    public boolean containsCustomDecoratorClass(Class<?> clazz)
+    {
+        Asserts.nullCheckForClass(clazz);
+        return additionalDecoratorClasses.contains(clazz);
+    }
+
+    public void clear()
+    {
+        additionalDecoratorClasses.clear();
+    }
 }

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=1429566&r1=1429565&r2=1429566&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  6 18:45:02 2013
@@ -144,7 +144,7 @@ public class AfterBeanDiscoveryImpl impl
 
 
             beanManager.addDecorator(new WebBeansDecorator(managedBean, (Decorator) bean));
-            webBeansContext.getBeanManagerImpl().addCustomDecoratorClass(bean.getBeanClass());
+            webBeansContext.getDecoratorsManager().addCustomDecoratorClass(bean.getBeanClass());
         }
         else
         {



Mime
View raw message