summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
index f301082d59..160b9d84c8 100644
--- a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
+++ b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.implementation.bpel.ode.provider;
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 @@ import org.w3c.dom.Element;
* @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 @@ public class BPELInvoker implements Invoker {
// 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());
}