Return-Path: Delivered-To: apmail-ode-commits-archive@www.apache.org Received: (qmail 58754 invoked from network); 14 May 2008 01:33:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 May 2008 01:33:36 -0000 Received: (qmail 14903 invoked by uid 500); 14 May 2008 01:33:38 -0000 Delivered-To: apmail-ode-commits-archive@ode.apache.org Received: (qmail 14887 invoked by uid 500); 14 May 2008 01:33:38 -0000 Mailing-List: contact commits-help@ode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ode.apache.org Delivered-To: mailing list commits@ode.apache.org Received: (qmail 14876 invoked by uid 99); 14 May 2008 01:33:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2008 18:33:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 May 2008 01:32:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 93EBA2388A00; Tue, 13 May 2008 18:33:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r656078 - in /ode/trunk: ./ axis2/src/main/java/org/apache/ode/axis2/ bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ Date: Wed, 14 May 2008 01:33:12 -0000 To: commits@ode.apache.org From: mriou@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080514013312.93EBA2388A00@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mriou Date: Tue May 13 18:33:12 2008 New Revision: 656078 URL: http://svn.apache.org/viewvc?rev=656078&view=rev Log: First trunk fixes: async unreliable invoke was broken due to status / commit timing issues. Modified: ode/trunk/Rakefile ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ExternalService.java ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java Modified: ode/trunk/Rakefile URL: http://svn.apache.org/viewvc/ode/trunk/Rakefile?rev=656078&r1=656077&r2=656078&view=diff ============================================================================== --- ode/trunk/Rakefile (original) +++ ode/trunk/Rakefile Tue May 13 18:33:12 2008 @@ -185,6 +185,8 @@ cp Dir[_("src/main/webapp/WEB-INF/classes/*")], _("target/test-classes") cp Dir[project("axis2").path_to("src/main/wsdl/*")], _("target/test-classes/webapp/WEB-INF") cp project("bpel-schemas").path_to("src/main/xsd/pmapi.xsd"), _("target/test-classes/webapp/WEB-INF") + mkdir_p _("target/test-classes/webapp/WEB-INF/processes") + rm_rf Dir[_("target/test-classes/webapp") + "/**/.svn"] end test.setup unzip(_("target/test-classes/webapp/WEB-INF")=>project("dao-jpa-ojpa-derby").package(:zip)) end Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ExternalService.java URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ExternalService.java?rev=656078&r1=656077&r2=656078&view=diff ============================================================================== --- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ExternalService.java (original) +++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ExternalService.java Tue May 13 18:33:12 2008 @@ -136,7 +136,6 @@ operationClient.addMessageContext(mctx); if (isTwoWay) { - final String mexId = odeMex.getMessageExchangeId(); final Operation operation = odeMex.getOperation(); try { @@ -147,14 +146,14 @@ __log.debug("Service response:\n" + response.getEnvelope().toString()); if (flt != null) { - reply(mexId, operation, flt, true); + reply(odeMex, operation, flt, true); } else { - reply(mexId, operation, response, response.isFault()); + reply(odeMex, operation, response, response.isFault()); } } catch (Throwable t) { String errmsg = "Error sending message to Axis2 for ODE mex " + odeMex; __log.error(errmsg, t); - replyWithFailure(mexId, MessageExchange.FailureType.COMMUNICATION_ERROR, errmsg, null); + replyWithFailure(odeMex, MessageExchange.FailureType.COMMUNICATION_ERROR, errmsg, null); } } else /* one-way case */{ operationClient.execute(false); @@ -255,9 +254,8 @@ return _serviceName; } - private void replyWithFailure(final String odeMexId, final FailureType error, final String errmsg, final Element details) { + private void replyWithFailure(final PartnerRoleMessageExchange odeMex, final FailureType error, final String errmsg, final Element details) { try { - PartnerRoleMessageExchange odeMex = (PartnerRoleMessageExchange) _server.getMessageExchange(odeMexId); odeMex.replyWithFailure(error, errmsg, details); } catch (Exception e) { String emsg = "Error executing replyWithFailure; reply will be lost."; @@ -267,7 +265,7 @@ } - private void reply(final String odeMexId, final Operation operation, final MessageContext reply, final boolean fault) { + private void reply(final PartnerRoleMessageExchange odeMex, final Operation operation, final MessageContext reply, final boolean fault) { final Document odeMsg = DOMUtils.newDocument(); final Element odeMsgEl = odeMsg.createElementNS(null, "message"); odeMsg.appendChild(odeMsgEl); @@ -283,12 +281,11 @@ } } catch (AxisFault af) { __log.warn("Message format error, failing.", af); - replyWithFailure(odeMexId, FailureType.FORMAT_ERROR, af.getMessage(), null); + replyWithFailure(odeMex, FailureType.FORMAT_ERROR, af.getMessage(), null); return; } try { - PartnerRoleMessageExchange odeMex = (PartnerRoleMessageExchange) _server.getMessageExchange(odeMexId); QName nonNullFT = new QName(Namespaces.ODE_EXTENSION_NS, "unknownFault"); if (faultType != null) { Fault f = odeMex.getOperation().getFault(faultType.getLocalPart()); Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java?rev=656078&r1=656077&r2=656078&view=diff ============================================================================== --- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java (original) +++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java Tue May 13 18:33:12 2008 @@ -130,10 +130,13 @@ private void invokePersisted(MessageExchangeDAO mexDao, EndpointReference partnerEpr, EndpointReference myRoleEpr, Operation operation, Set supportedStyles) { if (supportedStyles.contains(InvocationStyle.TRANSACTED)) { + mexDao.setInvocationStyle(InvocationStyle.TRANSACTED); invokeTransacted(mexDao, partnerEpr, myRoleEpr, operation); } else if (supportedStyles.contains(InvocationStyle.RELIABLE)) { + mexDao.setInvocationStyle(InvocationStyle.RELIABLE); invokeReliable(mexDao, partnerEpr, myRoleEpr, operation); } else if (supportedStyles.contains(InvocationStyle.UNRELIABLE)) { + mexDao.setInvocationStyle(InvocationStyle.UNRELIABLE); invokeUnreliable(mexDao, partnerEpr, myRoleEpr, operation); } else { // This really should not happen, indicates IL is screwy. @@ -362,8 +365,7 @@ } } ); return; - } - + } // We proceed handling the response in a transaction. Note that if for some reason the following transaction // fails, the unreliable invoke will be in an "unknown" state, and will require manual intervention to either Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java?rev=656078&r1=656077&r2=656078&view=diff ============================================================================== --- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java (original) +++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerRoleMessageExchangeImpl.java Tue May 13 18:33:12 2008 @@ -248,7 +248,7 @@ if (_state == State.DEAD) throw new IllegalStateException("Object used in inappropriate context. "); - if (getStatus() != MessageExchange.Status.REQ) + if (getStatus() != MessageExchange.Status.REQ && getStatus() != MessageExchange.Status.ASYNC) throw new IllegalStateException("Invalid message exchange state, expect REQ but got " + getStatus()); }