axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r635169 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: AxisFault.java Constants.java engine/AxisEngine.java receivers/AbstractMessageReceiver.java
Date Sun, 09 Mar 2008 04:47:21 GMT
Author: amilas
Date: Sat Mar  8 20:47:20 2008
New Revision: 635169

URL: http://svn.apache.org/viewvc?rev=635169&view=rev
Log:
this change do not make any effect to the axis2 excecution paths. Here I added some constants
to identify the 
AxisFault types. This is very important for an RM Implementation. Added resumeSendFault method
to resume fault 
flows

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java?rev=635169&r1=635168&r2=635169&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java Sat Mar
 8 20:47:20 2008
@@ -620,4 +620,17 @@
     public String getMessage() {
         return message;
     }
+
+    /**
+     * this field is used to identify the axis2 fault type
+     */
+    private int faultType;
+
+    public int getFaultType() {
+        return faultType;
+    }
+
+    public void setFaultType(int faultType) {
+        this.faultType = faultType;
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java?rev=635169&r1=635168&r2=635169&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java Sat Mar
 8 20:47:20 2008
@@ -238,6 +238,14 @@
     public static final String DEFAULT_REST_PATH = "rest";
     public static final String DEFAULT_SERVICES_PATH = "services";
 
+    public static final int APPLICATION_FAULT = 1;
+    public static final int TRANSPORT_FAULT = 2;
+    public static final int SOAP_PROCESSING_FAULT = 3;
+
+    public static final String APPLICATION_FAULT_STRING = "applicationFault";
+    public static final String TRANSPORT_FAULT_STRING = "transportFault";
+    public static final String SOAP_PROCESSING_FAULT_STRING = "soapProcessingFault";
+
     /**
      * Field Builder Selector
      */

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?rev=635169&r1=635168&r2=635169&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
Sat Mar  8 20:47:20 2008
@@ -511,6 +511,68 @@
         }
     }
 
+    /**
+     * here we assume that it is resume from an operation level handler
+     * @param msgContext
+     * @throws AxisFault
+     */
+    public static void resumeSendFault(MessageContext msgContext) throws AxisFault{
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+            log.trace(msgContext.getLogIDString() + " resumeSendFault:" + msgContext.getMessageID());
+        }
+        OperationContext opContext = msgContext.getOperationContext();
+
+        if (opContext != null) {
+
+            try {
+                InvocationResponse pi = invoke(msgContext, RESUMING_EXECUTION);
+
+                if (pi.equals(InvocationResponse.SUSPEND)) {
+                    log.warn(msgContext.getLogIDString() +
+                            " The resumption of this flow may function incorrectly, as the
OutFaultFlow will not be used");
+                    return;
+                } else if (pi.equals(InvocationResponse.ABORT)) {
+                    flowComplete(msgContext);
+                    return;
+                } else if (!pi.equals(InvocationResponse.CONTINUE)) {
+                    String errorMsg =
+                            "Unrecognized InvocationResponse encountered in AxisEngine.sendFault()";
+                    log.error(msgContext.getLogIDString() + " " + errorMsg);
+                    throw new AxisFault(errorMsg);
+                }
+            } catch (AxisFault e) {
+                msgContext.setFailureReason(e);
+                flowComplete(msgContext);
+                throw e;
+            }
+        }
+
+        msgContext.setExecutionChain((ArrayList) msgContext.getConfigurationContext()
+                .getAxisConfiguration().getOutFaultFlowPhases().clone());
+        msgContext.setFLOW(MessageContext.OUT_FAULT_FLOW);
+        InvocationResponse pi = invoke(msgContext, NOT_RESUMING_EXECUTION);
+
+        if (pi.equals(InvocationResponse.CONTINUE)) {
+            // Actually send the SOAP Fault
+            TransportOutDescription transportOut = msgContext.getTransportOut();
+            if (transportOut == null) {
+                throw new AxisFault("Transport out has not been set");
+            }
+            TransportSender sender = transportOut.getSender();
+
+            sender.invoke(msgContext);
+            flowComplete(msgContext);
+        } else if (pi.equals(InvocationResponse.SUSPEND)) {
+        } else if (pi.equals(InvocationResponse.ABORT)) {
+            flowComplete(msgContext);
+        } else {
+            String errorMsg =
+                    "Unrecognized InvocationResponse encountered in AxisEngine.sendFault()";
+            log.error(msgContext.getLogIDString() + " " + errorMsg);
+            throw new AxisFault(errorMsg);
+        }
+    }
+
 
     /**
      * This class is used when someone invoke a service invocation with two transports

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java?rev=635169&r1=635168&r2=635169&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
Sat Mar  8 20:47:20 2008
@@ -100,6 +100,7 @@
                     !WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(messageCtx.getAxisOperation().getMessageExchangePattern()))
{
                 log.error(fault);
             } else {
+                fault.setFaultType(Constants.APPLICATION_FAULT);
                 throw fault;
             }
         } finally {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message