tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r811496 - /tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
Date Fri, 04 Sep 2009 17:13:29 GMT
Author: lresende
Date: Fri Sep  4 17:13:28 2009
New Revision: 811496

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

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

Modified: tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java?rev=811496&r1=811495&r2=811496&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
Fri Sep  4 17:13:28 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;
@@ -55,8 +56,11 @@
  * @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;
     private TransactionManager txMgr;
     
@@ -151,7 +155,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());
             }



Mime
View raw message