diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-04 17:13:28 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-04 17:13:28 +0000 |
commit | 9aeacb7f587490b9067e84a118b62675f1f76f58 (patch) | |
tree | 3187ec56ec98f2ece83daf4787eab0fcff4af87d /branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache | |
parent | 2ca279a0eb7890f736ca8d5060bb52bcc13d9a94 (diff) |
TUSCANY-2995 - Adding timeout to avoid blocking when exception occours
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@811496 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache')
-rw-r--r-- | branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java | 7 |
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()); } |