openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r802932 - in /incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config: DefinitionUtil.java WebBeansContainerDeployer.java
Date Mon, 10 Aug 2009 21:44:08 GMT
Author: gerdogdu
Date: Mon Aug 10 21:44:08 2009
New Revision: 802932

URL: http://svn.apache.org/viewvc?rev=802932&view=rev
Log:
Updating disposal method resulotions. Add disposal methods after adding producer methods to
container.

Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=802932&r1=802931&r2=802932&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Mon Aug 10 21:44:08 2009
@@ -778,9 +778,6 @@
             }
 
             Set<Bean<?>> set = InjectionResolver.getInstance().implResolveByType(type,
annot);
-            if (set == null || set.isEmpty()) {
-                continue;
-            }
             Bean<?> bean = set.iterator().next();
             ProducerMethodBean<?> pr = null;
 
@@ -807,6 +804,13 @@
                 }
             }
 
+            Method producerMethod = pr.getCreatorMethod();
+            //Disposer methods and producer methods must be in the same class
+            if(!producerMethod.getDeclaringClass().getName().equals(declaredMethod.getDeclaringClass().getName()))
+            {
+                throw new WebBeansConfigurationException("Producer method component of the
disposal method : " + declaredMethod.getName() + " in class : " + clazz.getName() + " must
be in the same class!");
+            }
+            
             pr.setDisposalMethod(declaredMethod);
 
             addMethodInjectionPointMetaData(component, declaredMethod);

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java?rev=802932&r1=802931&r2=802932&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
Mon Aug 10 21:44:08 2009
@@ -633,7 +633,6 @@
             managedBeanCreator.defineConstructor();            
             Set<ProducerMethodBean<?>> producerMethods = managedBeanCreator.defineProducerMethods();
      
             Set<ProducerFieldBean<?>> producerFields = managedBeanCreator.defineProducerFields();
          
-            managedBeanCreator.defineDisposalMethods();
             managedBeanCreator.defineInjectedFields();
             managedBeanCreator.defineInjectedMethods();
             managedBeanCreator.defineObserverMethods();
@@ -700,6 +699,7 @@
                 DecoratorUtil.checkManagedBeanDecoratorConditions(managedBean);
                 BeanManagerImpl.getManager().addBean(managedBean);
                 BeanManagerImpl.getManager().getBeans().addAll(producerMethods);
+                managedBeanCreator.defineDisposalMethods();//Define disposal method after
adding producers
                 BeanManagerImpl.getManager().getBeans().addAll(producerFields);
             }
         }



Mime
View raw message