ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r544501 - /incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
Date Tue, 05 Jun 2007 14:22:22 GMT
Author: mriou
Date: Tue Jun  5 07:22:21 2007
New Revision: 544501

URL: http://svn.apache.org/viewvc?view=rev&rev=544501
Log:
Fixing a possible NPE after an in-mem mex is released.

Modified:
    incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java

Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?view=diff&rev=544501&r1=544500&r2=544501
==============================================================================
--- incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
(original)
+++ incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
Tue Jun  5 07:22:21 2007
@@ -1038,21 +1038,23 @@
         String[] mexRefs = _outstandingRequests.releaseAll();
         for (String mexId : mexRefs) {
             MessageExchangeDAO mexDao = _dao.getConnection().getMessageExchange(mexId);
-            MyRoleMessageExchangeImpl mex = new MyRoleMessageExchangeImpl(_bpelProcess._engine,
mexDao);
-            switch (mex.getStatus()) {
-            case ASYNC:
-            case RESPONSE:
-                mex.setStatus(MessageExchange.Status.COMPLETED_OK);
-                break;
-            case REQUEST:
-                if (mex.getPattern().equals(MessageExchange.MessageExchangePattern.REQUEST_ONLY))
{
+            if (mexDao != null) {
+                MyRoleMessageExchangeImpl mex = new MyRoleMessageExchangeImpl(_bpelProcess._engine,
mexDao);
+                switch (mex.getStatus()) {
+                case ASYNC:
+                case RESPONSE:
                     mex.setStatus(MessageExchange.Status.COMPLETED_OK);
                     break;
+                case REQUEST:
+                    if (mex.getPattern().equals(MessageExchange.MessageExchangePattern.REQUEST_ONLY))
{
+                        mex.setStatus(MessageExchange.Status.COMPLETED_OK);
+                        break;
+                    }
+                default:
+                    mex.setFailure(FailureType.OTHER, "No response.", null);
+                    _bpelProcess._engine._contexts.mexContext.onAsyncReply(mex);
+                    mex.release();
                 }
-            default:
-                mex.setFailure(FailureType.OTHER, "No response.", null);
-                _bpelProcess._engine._contexts.mexContext.onAsyncReply(mex);
-                mex.release();
             }
         }
     }
@@ -1061,17 +1063,19 @@
         String[] mexRefs = _outstandingRequests.releaseAll();
         for (String mexId : mexRefs) {
             MessageExchangeDAO mexDao = _dao.getConnection().getMessageExchange(mexId);
-            MyRoleMessageExchangeImpl mex = new MyRoleMessageExchangeImpl(_bpelProcess._engine,
mexDao);
-            _bpelProcess.initMyRoleMex(mex);
+            if (mexDao != null) {
+                MyRoleMessageExchangeImpl mex = new MyRoleMessageExchangeImpl(_bpelProcess._engine,
mexDao);
+                _bpelProcess.initMyRoleMex(mex);
 
-            Message message = mex.createMessage(faultData.getFaultName());
-            if (faultData.getFaultMessage() != null)
-                message.setMessage(faultData.getFaultMessage());
-            mex.setResponse(message);
+                Message message = mex.createMessage(faultData.getFaultName());
+                if (faultData.getFaultMessage() != null)
+                    message.setMessage(faultData.getFaultMessage());
+                mex.setResponse(message);
 
-            mex.setFault(faultData.getFaultName(), message);
-            mex.setFaultExplanation(faultData.getExplanation());
-            _bpelProcess._engine._contexts.mexContext.onAsyncReply(mex);
+                mex.setFault(faultData.getFaultName(), message);
+                mex.setFaultExplanation(faultData.getExplanation());
+                _bpelProcess._engine._contexts.mexContext.onAsyncReply(mex);
+            }
         }
     }
 



Mime
View raw message