tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r811501 - /tuscany/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
Date Fri, 04 Sep 2009 17:27:50 GMT
Author: lresende
Date: Fri Sep  4 17:27:49 2009
New Revision: 811501

URL: http://svn.apache.org/viewvc?rev=811501&view=rev
Log:
TUSCANY-2995 - Adding timeout to avoid blocking when exception occours

Modified:
    tuscany/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java

Modified: tuscany/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java?rev=811501&r1=811500&r2=811501&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
(original)
+++ tuscany/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
Fri Sep  4 17:27:49 2009
@@ -21,6 +21,7 @@
 
 import java.lang.reflect.InvocationTargetException;
 import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 
 import javax.transaction.SystemException;
 import javax.transaction.TransactionManager;
@@ -29,13 +30,11 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.iapi.MessageExchange;
 import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
 import org.apache.ode.bpel.iapi.MessageExchange.Status;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.GUID;
 import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.assembly.Endpoint;
 import org.apache.tuscany.sca.assembly.EndpointReference;
 import org.apache.tuscany.sca.implementation.bpel.ode.EmbeddedODEServer;
 import org.apache.tuscany.sca.interfacedef.Interface;
@@ -59,6 +58,8 @@
  * @version $Rev$ $Date$
  */
 public class BPELInvoker implements Invoker {
+	private final static long TIME_OUT = 500L;
+	
     protected final Log __log = LogFactory.getLog(getClass());
 
     private EmbeddedODEServer odeServer;
@@ -166,7 +167,8 @@
         // Waiting until the reply is ready in case the engine needs to continue in a different
thread
         if (onhold != null) {
             try {
-                onhold.get();
+            	//add timeout to avoid blocking when there is a exception/failure
+            	onhold.get(TIME_OUT, TimeUnit.MILLISECONDS);
             } catch (Exception e) {
                 throw new InvocationTargetException(e,"Error invoking BPEL process : " +
e.getMessage());
             } // end try



Mime
View raw message