openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r982352 - in /openwebbeans/trunk: webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/ webbeans-impl/src/main/java/org/apache/webbeans/container/ webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/
Date Wed, 04 Aug 2010 18:32:10 GMT
Author: dblevins
Date: Wed Aug  4 18:32:10 2010
New Revision: 982352

URL: http://svn.apache.org/viewvc?rev=982352&view=rev
Log:
Tweaked to better handle duplicate definitions in the EJB layer

Added:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/DuplicateDefinitionException.java
      - copied, changed from r982092, openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/NonexistentConstructorException.java
Modified:
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java?rev=982352&r1=982351&r2=982352&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
(original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
Wed Aug  4 18:32:10 2010
@@ -42,6 +42,7 @@ import org.apache.webbeans.ejb.common.co
 import org.apache.webbeans.event.ObserverMethodImpl;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansException;
+import org.apache.webbeans.exception.definition.DuplicateDefinitionException;
 import org.apache.webbeans.portable.AnnotatedElementFactory;
 import org.apache.webbeans.portable.events.ProcessAnnotatedTypeImpl;
 import org.apache.webbeans.portable.events.ProcessInjectionTargetImpl;
@@ -155,8 +156,14 @@ public final class EjbUtility
         WebBeansUtil.fireProcessObservableMethodBeanEvent(observerMethodsMap);
         WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessObserverMethod
event observers for observer methods. Look at logs for further details");
 
+        try
+        {
+            manager.addBean(WebBeansUtil.createNewBean(ejbBean));
+        }
+        catch (DuplicateDefinitionException ignore)
+        {
+        }
         
-        manager.addBean(WebBeansUtil.createNewBean(ejbBean));                
         manager.addBean(ejbBean);
         manager.getBeans().addAll(producerMethodBeans);
         ejbBeanCreator.defineDisposalMethods();

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=982352&r1=982351&r2=982352&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
Wed Aug  4 18:32:10 2010
@@ -72,6 +72,7 @@ import org.apache.webbeans.decorator.Web
 import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
 import org.apache.webbeans.event.NotificationManager;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.apache.webbeans.exception.definition.DuplicateDefinitionException;
 import org.apache.webbeans.exception.inject.DefinitionException;
 import org.apache.webbeans.intercept.InterceptorComparator;
 import org.apache.webbeans.intercept.WebBeansInterceptorConfig;
@@ -320,14 +321,14 @@ public class BeanManagerImpl implements 
     {
         if(newBean instanceof AbstractOwbBean)
         {
-            this.deploymentBeans.add(newBean);
             addPassivationInfo((OwbBean)newBean);
+            this.deploymentBeans.add(newBean);
         }
         else
         {
             ThirdpartyBeanImpl<?> bean = new ThirdpartyBeanImpl(newBean);
-            this.deploymentBeans.add(bean);
             addPassivationInfo(bean);
+            this.deploymentBeans.add(bean);
         }
         
 
@@ -348,7 +349,7 @@ public class BeanManagerImpl implements 
             Bean<?> oldBean = passivationBeans.putIfAbsent(id, bean);
             if (oldBean != null)
             {
-                throw new DefinitionException("PassivationCapable bean id is not unique:
" + id + " bean:" + bean);
+                throw new DuplicateDefinitionException("PassivationCapable bean id is not
unique: " + id + " bean:" + bean);
             }
             
         }        

Copied: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/DuplicateDefinitionException.java
(from r982092, openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/NonexistentConstructorException.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/DuplicateDefinitionException.java?p2=openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/DuplicateDefinitionException.java&p1=openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/NonexistentConstructorException.java&r1=982092&r2=982352&rev=982352&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/NonexistentConstructorException.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/exception/definition/DuplicateDefinitionException.java
Wed Aug  4 18:32:10 2010
@@ -20,26 +20,26 @@ package org.apache.webbeans.exception.de
 
 import org.apache.webbeans.exception.inject.DefinitionException;
 
-public class NonexistentConstructorException extends DefinitionException
+public class DuplicateDefinitionException extends DefinitionException
 {
-    private static final long serialVersionUID = 5271502302312280463L;
+    private static final long serialVersionUID = 2312285271502063304L;
 
-    public NonexistentConstructorException()
+    public DuplicateDefinitionException()
     {
         super();
     }
 
-    public NonexistentConstructorException(String message)
+    public DuplicateDefinitionException(String message)
     {
         super(message);
     }
 
-    public NonexistentConstructorException(Throwable e)
+    public DuplicateDefinitionException(Throwable e)
     {
         super(e);
     }
 
-    public NonexistentConstructorException(String message, Throwable e)
+    public DuplicateDefinitionException(String message, Throwable e)
     {
         super(message, e);
     }



Mime
View raw message