tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r535578 - in /incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb: EndpointHandler.java MdbContainer.java
Date Sun, 06 May 2007 01:59:02 GMT
Author: kevan
Date: Sat May  5 18:59:00 2007
New Revision: 535578

URL: http://svn.apache.org/viewvc?view=rev&rev=535578
Log:
Fix IllegalStateException in afterDelivery() when EndpointHandler is driving before/afterDelivery
calls. things aren't quite right, yet, but this helps...

Modified:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java?view=diff&rev=535578&r1=535577&r2=535578
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
Sat May  5 18:59:00 2007
@@ -45,8 +45,8 @@
         BEFORE_CALLED,
 
         /**
-         * The message delivery method has been called successfully, and the next method
called must be afterDelivery
-         * or release.
+         * The message delivery method has been called successfully, and the next method
called must be 
+         * another message delivery method, afterDelivery, or release.
          */
         METHOD_CALLED,
 
@@ -198,27 +198,28 @@
     }
 
     public Object deliverMessage(Method method, Object[] args) throws Throwable {
+        
+        boolean callBeforeAfter = false;
+        
         // verify current state
         switch (state) {
-            case RELEASED:
-                throw new IllegalStateException("Message endpoint factory has been released");
+            case NONE:
+                try {
+                    beforeDelivery(method);
+                } catch (ApplicationServerInternalException e) {
+                    throw (EJBException) new EJBException().initCause(e.getCause());
+                }
+                callBeforeAfter = true;
+                state = State.METHOD_CALLED;
+                break;
             case BEFORE_CALLED:
                 state = State.METHOD_CALLED;
                 break;
+            case RELEASED:
+                throw new IllegalStateException("Message endpoint factory has been released");
             case METHOD_CALLED:
             case SYSTEM_EXCEPTION:
                 throw new IllegalStateException("The last message delivery must be completed
with an afterDeliver before another message can be delivered");
-        }
-
-
-        // if beforeDelivery was not called, call it now
-        boolean callBeforeAfter = (state == State.NONE);
-        if (callBeforeAfter) {
-            try {
-                beforeDelivery(method);
-            } catch (ApplicationServerInternalException e) {
-                throw (EJBException) new EJBException().initCause(e.getCause());
-            }
         }
 
         Throwable throwable = null;

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java?view=diff&rev=535578&r1=535577&r2=535578
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java
Sat May  5 18:59:00 2007
@@ -157,7 +157,7 @@
             try {
                 activationSpec.validate();
             } catch (UnsupportedOperationException uoe) {
-                logger.info("ActivationSpec does not support validate. Implementation of
validate is optional", uoe);
+                logger.info("ActivationSpec does not support validate. Implementation of
validate is optional");
             }
             
 



Mime
View raw message