synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sami...@apache.org
Subject svn commit: r421621 - in /incubator/synapse/trunk/java: modules/core/conf/ modules/core/src/org/apache/synapse/ modules/core/src/org/apache/synapse/core/axis2/ modules/core/test-resources/axis2/conf/ modules/core/test-resources/rest/conf/ modules/core/...
Date Thu, 13 Jul 2006 13:33:35 GMT
Author: saminda
Date: Thu Jul 13 06:33:34 2006
New Revision: 421621

URL: http://svn.apache.org/viewvc?rev=421621&view=rev
Log:
Improving RM handling on Synapse. Please note i have put TODO and souts, which will be deleted
soon. 

Added:
    incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java
Modified:
    incubator/synapse/trunk/java/modules/core/conf/module.xml
    incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/Constants.java
    incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
    incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/EmptyRMMessageReceiver.java
    incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseAxis2Interceptor.java
    incubator/synapse/trunk/java/modules/core/test-resources/axis2/conf/axis2.xml
    incubator/synapse/trunk/java/modules/core/test-resources/rest/conf/axis2-rest.xml
    incubator/synapse/trunk/java/modules/core/test-resources/tcp/axis2-tcp.xml
    incubator/synapse/trunk/java/repository/conf/axis2.xml

Modified: incubator/synapse/trunk/java/modules/core/conf/module.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/conf/module.xml?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/conf/module.xml (original)
+++ incubator/synapse/trunk/java/modules/core/conf/module.xml Thu Jul 13 06:33:34 2006
@@ -10,6 +10,10 @@
                  class="org.apache.synapse.core.axis2.SynapseDispatcher">
             <order after="SOAPMessageBodyBasedDispatcher" phase="Dispatch"/>
         </handler>
+        <handler name="SynapseMustUnderstandHandler"
+                 class="org.apache.synapse.core.axis2.SynapseMustUnderstandHandler">
+            <order phase="MUPhase"/>
+        </handler>
     </inflow>
 
 </module>

Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/Constants.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/Constants.java?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/Constants.java (original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/Constants.java Thu Jul
13 06:33:34 2006
@@ -74,7 +74,9 @@
 
     /** The QName of the WS-Security Rampart module */
     QName RAMPART_MODULE_NAME = new QName("rampart");
-
+    /** Sandesha2 engaged service being process*/
     String MESSAGE_RECEIVED_RM_ENGAGED = "__MESSAGE_RECEIVED_RM_ENGAGED__";
+
+    String PROCESSED_MUST_UNDERSTAND = "__PROCESSED_MUST_UNDERSTAND__";
 
 }

Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
(original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
Thu Jul 13 06:33:34 2006
@@ -137,6 +137,10 @@
             axisMsgCtx.getProperty(MessageContext.TRANSPORT_OUT));
         response.setProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO,
             axisMsgCtx.getProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO));
+        response.setProperty(
+                org.apache.synapse.Constants.PROCESSED_MUST_UNDERSTAND,
+                axisMsgCtx.getProperty(
+                        org.apache.synapse.Constants.PROCESSED_MUST_UNDERSTAND));
         response.setTransportIn(axisMsgCtx.getTransportIn());
         response.setTransportOut(savedTransportOut);
 

Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/EmptyRMMessageReceiver.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/EmptyRMMessageReceiver.java?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/EmptyRMMessageReceiver.java
(original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/EmptyRMMessageReceiver.java
Thu Jul 13 06:33:34 2006
@@ -28,6 +28,9 @@
          Message Recieved with RM
         */
         //TODO : SynapseEnvironment Inject
+        System.out.println("########  EmptyRMMessageReceiver ######");
+        System.out.println("########   Envelope  :  " + messageContext.getEnvelope().toString());
+
         messageContext.setProperty(
                 org.apache.synapse.Constants.MESSAGE_RECEIVED_RM_ENGAGED,
                 Boolean.TRUE);

Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseAxis2Interceptor.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseAxis2Interceptor.java?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseAxis2Interceptor.java
(original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseAxis2Interceptor.java
Thu Jul 13 06:33:34 2006
@@ -21,6 +21,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.AxisFault;
 import org.apache.axiom.om.OMElement;
 import org.apache.synapse.SynapseException;
@@ -94,6 +95,11 @@
 
     //---------------------------------------------------------------------------------------
     public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {
+    }
+
+    public void serviceGroupUpdate(AxisEvent event,
+                                   AxisServiceGroup serviceGroup) {
+        //TODO
     }
 
     public void moduleUpdate(AxisEvent axisEvent, AxisModule axisModule) {

Added: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java?rev=421621&view=auto
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java
(added)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java
Thu Jul 13 06:33:34 2006
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.synapse.core.axis2;
+
+import org.apache.axis2.handlers.AbstractHandler;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.i18n.Messages;
+import org.apache.axiom.soap.*;
+
+import java.util.Iterator;
+/*
+ * 
+ */
+
+public class SynapseMustUnderstandHandler extends AbstractHandler {
+
+    public void invoke(MessageContext msgContext) throws AxisFault {
+        Object obj = msgContext.getProperty(
+                org.apache.synapse.Constants.PROCESSED_MUST_UNDERSTAND);
+        if (obj != null && ((Boolean) obj).booleanValue()) {
+            // second phase so return
+            return;
+        }
+        msgContext.setProperty(
+                org.apache.synapse.Constants.PROCESSED_MUST_UNDERSTAND,
+                Boolean.TRUE);
+        if (!msgContext.isHeaderPresent()) {
+            return;
+        }
+        SOAPEnvelope envelope = msgContext.getEnvelope();
+        if (envelope.getHeader() == null) {
+            return;
+        }
+        Iterator headerBlocks = envelope.getHeader().examineAllHeaderBlocks();
+        while (headerBlocks.hasNext()) {
+            SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) headerBlocks.next();
+            // if this header block has been processed or mustUnderstand isn't
+            // turned on then its cool
+            if (headerBlock.isProcessed() || !headerBlock.getMustUnderstand()) {
+                continue;
+            }
+            headerBlock.setProcessed();
+
+        }
+
+    }
+}

Modified: incubator/synapse/trunk/java/modules/core/test-resources/axis2/conf/axis2.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/test-resources/axis2/conf/axis2.xml?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/test-resources/axis2/conf/axis2.xml (original)
+++ incubator/synapse/trunk/java/modules/core/test-resources/axis2/conf/axis2.xml Thu Jul
13 06:33:34 2006
@@ -101,10 +101,12 @@
         </phase>
         <!--  System pre defined phases       -->
         <!--   After Postdispatch phase module author or or service author can add any
phase he want      -->
+        <phase name="MUPhase"/>
         <phase name="OperationInPhase"/>
     </phaseOrder>
     <phaseOrder type="outflow">
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationOutPhase"/>
         <!--system predefined phase-->
         <!--these phase will run irrespective of the service-->
@@ -139,10 +141,12 @@
             </handler>
         </phase>
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationInFaultPhase"/>
     </phaseOrder>
     <phaseOrder type="Outfaultflow">
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationOutFaultPhase"/>
         <phase name="PolicyDetermination"/>
         <phase name="MessageOut"/>

Modified: incubator/synapse/trunk/java/modules/core/test-resources/rest/conf/axis2-rest.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/test-resources/rest/conf/axis2-rest.xml?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/test-resources/rest/conf/axis2-rest.xml (original)
+++ incubator/synapse/trunk/java/modules/core/test-resources/rest/conf/axis2-rest.xml Thu
Jul 13 06:33:34 2006
@@ -101,10 +101,12 @@
         </phase>
         <!--  System pre defined phases       -->
         <!--   After Postdispatch phase module author or or service author can add any
phase he want      -->
+        <phase name="MUPhase"/>
         <phase name="OperationInPhase"/>
     </phaseOrder>
     <phaseOrder type="outflow">
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationOutPhase"/>
         <!--system predefined phase-->
         <!--these phase will run irrespective of the service-->
@@ -139,10 +141,12 @@
             </handler>
         </phase>
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationInFaultPhase"/>
     </phaseOrder>
     <phaseOrder type="Outfaultflow">
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationOutFaultPhase"/>
         <phase name="PolicyDetermination"/>
         <phase name="MessageOut"/>

Modified: incubator/synapse/trunk/java/modules/core/test-resources/tcp/axis2-tcp.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/test-resources/tcp/axis2-tcp.xml?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/test-resources/tcp/axis2-tcp.xml (original)
+++ incubator/synapse/trunk/java/modules/core/test-resources/tcp/axis2-tcp.xml Thu Jul 13
06:33:34 2006
@@ -103,10 +103,12 @@
         </phase>
         <!--  System pre defined phases       -->
         <!--   After Postdispatch phase module author or or service author can add any
phase he want      -->
+        <phase name="MUPhase"/>
         <phase name="OperationInPhase"/>
     </phaseOrder>
     <phaseOrder type="outflow">
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationOutPhase"/>
         <!--system predefined phase-->
         <!--these phase will run irrespective of the service-->
@@ -141,10 +143,12 @@
             </handler>
         </phase>
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationInFaultPhase"/>
     </phaseOrder>
     <phaseOrder type="Outfaultflow">
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="OperationOutFaultPhase"/>
         <phase name="PolicyDetermination"/>
         <phase name="MessageOut"/>

Modified: incubator/synapse/trunk/java/repository/conf/axis2.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/axis2.xml?rev=421621&r1=421620&r2=421621&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/axis2.xml (original)
+++ incubator/synapse/trunk/java/repository/conf/axis2.xml Thu Jul 13 06:33:34 2006
@@ -137,11 +137,13 @@
         </phase>
         <!--  System pre defined phases       -->
         <phase name="RMPhase"/>
+        <phase name="MUPhase"/>
         <!--   After Postdispatch phase module author or or service author can add any
phase he want      -->
         <phase name="OperationInPhase"/>
     </phaseOrder>
     <phaseOrder type="outflow">
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="RMPhase"/>
         <phase name="OperationOutPhase"/>
         <!--system predefined phase-->
@@ -178,10 +180,12 @@
         </phase>
         <!--      user can add his own phases to this area  -->
         <phase name="RMPhase"/>
+        <phase name="MUPhase"/>
         <phase name="OperationInFaultPhase"/>
     </phaseOrder>
     <phaseOrder type="Outfaultflow">
         <!--      user can add his own phases to this area  -->
+        <phase name="MUPhase"/>
         <phase name="RMPhase"/>
         <phase name="OperationOutFaultPhase"/>
         <phase name="PolicyDetermination"/>



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


Mime
View raw message