You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2009/09/04 19:13:29 UTC
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
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());
}