openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r809351 - /incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/component/creation/EjbBeanCreatorImpl.java
Date Sun, 30 Aug 2009 15:10:39 GMT
Author: gerdogdu
Date: Sun Aug 30 15:10:39 2009
New Revision: 809351

URL: http://svn.apache.org/viewvc?rev=809351&view=rev
Log:
OWB-127 Stateful EJBs have to be handled as being passivation capable

Modified:
    incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/component/creation/EjbBeanCreatorImpl.java

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/component/creation/EjbBeanCreatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/component/creation/EjbBeanCreatorImpl.java?rev=809351&r1=809350&r2=809351&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/component/creation/EjbBeanCreatorImpl.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/component/creation/EjbBeanCreatorImpl.java
Sun Aug 30 15:10:39 2009
@@ -15,10 +15,13 @@
 
 import java.util.List;
 
+import javax.enterprise.inject.spi.SessionBeanType;
+
 import org.apache.openejb.DeploymentInfo;
 import org.apache.webbeans.component.creation.AbstractInjectedTargetBeanCreator;
 import org.apache.webbeans.ejb.component.EjbBean;
 import org.apache.webbeans.ejb.util.EjbValidator;
+import org.apache.webbeans.exception.WebBeansPassivationException;
 
 /**
  * EjbBeanCreatorImpl.
@@ -47,9 +50,21 @@
      * {@inheritDoc}
      */
     @Override
-    public void defineScopeType(String errorMessage)
+    public void defineScopeType(String errorMessage) throws WebBeansPassivationException
     {
-        super.defineScopeType(errorMessage);
+        try
+        {
+            super.defineScopeType(errorMessage);   
+        }
+        catch(WebBeansPassivationException e)
+        {
+            SessionBeanType type = getBean().getEjbType();
+            if(!type.equals(SessionBeanType.STATEFUL))
+            {
+                throw e;
+            }
+        }
+        
         EjbValidator.validateEjbScopeType(getBean());
         EjbValidator.validateGenericBeanType(getBean().getReturnType(), getBean().getScopeType());
     }
@@ -87,6 +102,5 @@
     public EjbBean<T> getBean()
     {
         return EjbBean.class.cast(super.getBean());
-    }
-    
+    }    
 }
\ No newline at end of file



Mime
View raw message