You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2008/05/14 03:33:12 UTC

svn commit: r656078 - in /ode/trunk: ./ axis2/src/main/java/org/apache/ode/axis2/ bpel-runtime/src/main/java/org/apache/ode/bpel/engine/

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<InvocationStyle> 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());
 
     }