You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by rr...@apache.org on 2010/07/12 17:48:48 UTC

svn commit: r963324 - in /ode/trunk: bpel-api/src/main/java/org/apache/ode/bpel/iapi/ bpel-runtime/src/main/java/org/apache/ode/bpel/engine/

Author: rr
Date: Mon Jul 12 15:48:48 2010
New Revision: 963324

URL: http://svn.apache.org/viewvc?rev=963324&view=rev
Log:
ODE-556: Rejecting in-out operations immediately when there's no route found

Added:
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/OdeGlobalConfig.java
Modified:
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java

Added: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/OdeGlobalConfig.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/OdeGlobalConfig.java?rev=963324&view=auto
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/OdeGlobalConfig.java (added)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/iapi/OdeGlobalConfig.java Mon Jul 12 15:48:48 2010
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.iapi;
+
+public class OdeGlobalConfig {
+    public static boolean queueInOutMessages() {
+        return Boolean.parseBoolean(System.getProperty("org.apache.ode.queueInOutMessages", "true"));
+    }
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java?rev=963324&r1=963323&r2=963324&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java Mon Jul 12 15:48:48 2010
@@ -38,6 +38,7 @@ import org.apache.ode.bpel.engine.replay
 import org.apache.ode.bpel.iapi.Message;
 import org.apache.ode.bpel.iapi.MessageExchange;
 import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.apache.ode.bpel.iapi.OdeGlobalConfig;
 import org.apache.ode.bpel.iapi.Scheduler;
 import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
 import org.apache.ode.bpel.iapi.Scheduler.JobDetails;
@@ -183,7 +184,11 @@ public class MyRoleMessageExchangeImpl e
     }
 
     public boolean isAsynchronous() {
-        return true;
+        if (OdeGlobalConfig.queueInOutMessages()) {
+            return true;
+        } else {
+            return getPattern() == MessageExchangePattern.REQUEST_ONLY;
+        }
     }
 
     public void release(boolean instanceSucceeded) {

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java?rev=963324&r1=963323&r2=963324&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java Mon Jul 12 15:48:48 2010
@@ -45,6 +45,7 @@ import org.apache.ode.bpel.evt.NewProces
 import org.apache.ode.bpel.iapi.Endpoint;
 import org.apache.ode.bpel.iapi.MessageExchange;
 import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.apache.ode.bpel.iapi.OdeGlobalConfig;
 import org.apache.ode.bpel.iapi.ProcessState;
 import org.apache.ode.bpel.iapi.Scheduler.JobDetails;
 import org.apache.ode.bpel.iapi.Scheduler.JobType;
@@ -256,6 +257,9 @@ public class PartnerLinkMyRoleImpl exten
     public void noRoutingMatch(MyRoleMessageExchangeImpl mex, List<RoutingInfo> routings) {
         if (!mex.isAsynchronous()) {
             mex.setFailure(MessageExchange.FailureType.NOMATCH, "No process instance matching correlation keys.", null);
+            if (!OdeGlobalConfig.queueInOutMessages()) {
+                _process._engine._contexts.mexContext.onAsyncReply(mex);
+            }
         } else {
             // enqueue message with the last message route, as per the comments in caller (@see BpelProcess.invokeProcess())
             RoutingInfo routing =