axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject svn commit: r766054 - in /webservices/axis2/branches/java/1_5: ./ modules/distribution/ modules/mtompolicy-mar/src/META-INF/ modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/ modules/mtompolicy/src/org/apache/axis2/policy/builders/ modules/mtompo...
Date Fri, 17 Apr 2009 15:34:43 GMT
Author: gdaniels
Date: Fri Apr 17 15:34:43 2009
New Revision: 766054

URL: http://svn.apache.org/viewvc?rev=766054&view=rev
Log:
Apply Nandana's patch for https://issues.apache.org/jira/browse/AXIS2-4313

Modified:
    webservices/axis2/branches/java/1_5/modules/distribution/pom.xml
    webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/META-INF/module.xml
    webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java
    webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java
    webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java
    webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM10AssertionBuilder.java
    webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM11AssertionBuilder.java
    webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java
    webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java
    webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java
    webservices/axis2/branches/java/1_5/modules/parent/pom.xml
    webservices/axis2/branches/java/1_5/modules/webapp/pom.xml
    webservices/axis2/branches/java/1_5/pom.xml

Modified: webservices/axis2/branches/java/1_5/modules/distribution/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/distribution/pom.xml?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/distribution/pom.xml (original)
+++ webservices/axis2/branches/java/1_5/modules/distribution/pom.xml Fri Apr 17 15:34:43 2009
@@ -361,6 +361,8 @@
                                       tofile="target/tmp-repository/modules/mex-${mex.mar.version}.mar"/>
                                 <copy file="../../modules/scripting/target/axis2-scripting-${version}.mar"
                                       tofile="target/tmp-repository/modules/scripting-${scripting.mar.version}.mar"/>
+                                <copy file="../../modules/mtompolicy-mar/target/mtompolicy-${mtompolicy.mar.version}.mar"
+                                      tofile="target/tmp-repository/modules/mtompolicy-${mtompolicy.mar.version}.mar"/>
 
                                 <!-- generate modules.list -->
                                 <echo file="target/tmp-repository/modules/modules.list"
append="false">

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/META-INF/module.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/META-INF/module.xml?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/META-INF/module.xml (original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/META-INF/module.xml Fri
Apr 17 15:34:43 2009
@@ -3,9 +3,14 @@
       This is the MTOM policy module. It is engaged when we have MTOM policy assertion.
     </Description>
     <supported-policy-namespaces namespaces="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization
http://www.w3.org/2007/08/soap12-mtom-policy"/>
+    <InFlow>
+        <handler name="MTOMInHandler" class="org.apache.axis2.mtompolicy.MTOMInHandler">
+            <order phase="PreDispatch"/>
+        </handler>
+    </InFlow>
     <OutFlow>
         <handler name="MTOMOutHandler" class="org.apache.axis2.mtompolicy.MTOMOutHandler">
             <order phase="MessageOut"/>
         </handler>
     </OutFlow>    
-</module>
\ No newline at end of file
+</module>

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java
(original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java
Fri Apr 17 15:34:43 2009
@@ -29,8 +29,20 @@
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
+/**
+ * This out handler does a check of the effective policy set. Based on that the corresponding
MTOM property </br>
+ * value is set.
+ */
 public class MTOMOutHandler extends AbstractHandler {
 
+	/**
+	 * Checks the effective policy set and based on it the <code>enableMTOM</code>
is set to the appropriate value.</br>
+	 * E.g. if the policy states that MTOM is <code>optional</code> then the <code>enableMTOM</code>
is set to this value.  
+	 * 
+	 * @param msgCtx the {@link MessageContext}
+     * 
+     * @throws AxisFault
+	 */
     public InvocationResponse invoke(MessageContext msgCtx) throws AxisFault {
 
         Policy policy = msgCtx.getEffectivePolicy();

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java
(original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java
Fri Apr 17 15:34:43 2009
@@ -33,11 +33,12 @@
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
+/**
+ * The module implementation class for the MTOM module.
+ *
+ */
 public class MTOMPolicy implements Module {
 
-    /*
-     * setup for logging
-     */
     private static final Log log = LogFactory.getLog(MTOMPolicy.class);
 
     public void applyPolicy(Policy policy, AxisDescription axisDescription)
@@ -45,7 +46,7 @@
         if (log.isDebugEnabled()) {
             log.debug("applyPolicy() called on MTOMPolicy module");
         }
-
+        
     }
 
     public boolean canSupportAssertion(Assertion assertion) {

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java
(original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java
Fri Apr 17 15:34:43 2009
@@ -34,16 +34,32 @@
 import org.apache.axis2.policy.model.MTOM10Assertion;
 import org.apache.axis2.policy.model.MTOMAssertion;
 import org.apache.axis2.util.PolicyUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
+/**
+ * This is a MTOM module utility class. It contains some useful methods used into the MTOM
module. 
+ */
 public class Utils {
 
+	private static final Log log = LogFactory.getLog(Utils.class);
+	
     private static final String MTOM_ASSERTION_APPLIED = "MTOM_ASSERTION_APPLIED";
 
+    /**
+     * Extracts the MTOM assertion object if it is exists into the policy based on a given
{@link AxisDescription}.
+     * 
+     * @param axisDescription the {@link AxisDescription} object that should be searched.
+     * @return {@link MTOMAssertion}  the {@link MTOMAssertion} found. If it is not found
"null" is returned.
+     */
     public static MTOMAssertion getMTOMAssertion(AxisDescription axisDescription) {
 
         if (axisDescription == null) {
+            if (log.isDebugEnabled()) {
+                log.debug("AxisDescription passed as parameter has a \"null\" value.");
+            }        	
             return null;
         }
 
@@ -70,6 +86,13 @@
 
     }
 
+    /**
+     * Locates the {@link AxisService} object searching up in the hierarchy recursively </br>
+     * the {@link AxisDescription} object passed.
+     *   
+     * @param axisDescription the {@link AxisDescription} object that should be checked.
+     * @return the {@link AxisService} object found or "null".
+     */
     public static AxisService locateAxisService(AxisDescription axisDescription) {
 
         if (axisDescription == null || axisDescription instanceof AxisService) {
@@ -79,12 +102,21 @@
         }
     }
 
+    /**
+     * Based on the parameter passed a {@link MTOM10Assertion} object is created by default.
</br>
+     * Then it is added to a {@link Policy} object and returned. 
+     * 
+     * @param param the {@link Parameter} object that contains the value of the "enableMTOM"
parameter: </br>
+     * "true" or "optional".
+     * @return The {@link Policy} object for the MTOM assertion. 
+     */
     public static Policy getMTOMPolicy(Parameter param) {
 
         if (param == null) {
             return null;
         }
 
+        // TODO We need to give the user the ability to specify if MTOM 1.0 or MTOM 1.1 should
be used.
         MTOMAssertion mtom10;
 
         if (Constants.VALUE_TRUE.equals(param.getValue())) {
@@ -103,6 +135,13 @@
 
     }
 
+    /**
+     * Applies the MTOM policy to the binding level of the web service.
+     * 
+     * @param axisService the {@link AxisService} to whom binding level the MTOM policy should
be attached.
+     * @param policy the {@link Policy} object that contains the MTOM assertion.
+     * @throws AxisFault thrown if the parameter is locked on a parent level - thus it could
not be added.
+     */
     public static void applyPolicyToSOAPBindings(AxisService axisService,
             Policy policy) throws AxisFault {
         
@@ -115,8 +154,7 @@
         for (Object obj : axisService.getEndpoints().values()) {
 
             AxisEndpoint endpoint = (AxisEndpoint) obj;
-            AxisBinding binding = endpoint.getBinding();
-
+            AxisBinding binding = endpoint.getBinding(); 
             if (Java2WSDLConstants.TRANSPORT_URI.equals(binding.getType())
                     || WSDL2Constants.URI_WSDL2_SOAP.equals(binding.getType())) {
                 binding.getPolicySubject().attachPolicy(policy);

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM10AssertionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM10AssertionBuilder.java?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM10AssertionBuilder.java
(original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM10AssertionBuilder.java
Fri Apr 17 15:34:43 2009
@@ -38,6 +38,8 @@
 import javax.xml.namespace.QName;
 
 /**
+ * This builder is responsible for the creation of a MTOM assertion object </br>
+ * (compliant with the WS-MTOMPolicy verion 1.0).
  * The builder will be picked by the
  * "org.apache.neethi.AssertionBuilderFactory".
  */

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM11AssertionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM11AssertionBuilder.java?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM11AssertionBuilder.java
(original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOM11AssertionBuilder.java
Fri Apr 17 15:34:43 2009
@@ -32,6 +32,13 @@
 import org.apache.neethi.Constants;
 import org.apache.neethi.builders.AssertionBuilder;
 
+/**
+ * This builder is responsible for the creation of a MTOM assertion object </br>
+ * (compliant with the WS-MTOMPolicy verion 1.1).
+ * The builder will be picked by the
+ * "org.apache.neethi.AssertionBuilderFactory".
+ */
+
 public class MTOM11AssertionBuilder implements AssertionBuilder{
     
     private static Log log = LogFactory.getLog(MTOM10AssertionBuilder.class);

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java
(original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java
Fri Apr 17 15:34:43 2009
@@ -28,8 +28,9 @@
 import org.apache.neethi.PolicyComponent;
 
 /**
- * Assertion to pick up the QName <wsoma:OptimizedMimeSerialization
- * xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
+ * Assertion to pick up the QName &ltwsoma:OptimizedMimeSerialization
+ * xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/&gt
 which is compliant <br>
+ * with the WS-MTOMPolicy verion 1.0.
  */
 public class MTOM10Assertion extends MTOMAssertion {
 

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java
(original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java
Fri Apr 17 15:34:43 2009
@@ -27,6 +27,12 @@
 import org.apache.neethi.Constants;
 import org.apache.neethi.PolicyComponent;
 
+/**
+ * Assertion to pick up the QName &ltwsoma:MTOM
+ * xmlns:wsoma="http://www.w3.org/2007/08/soap12-mtom-policy"/&gt which is compliant
</br>
+ * with the WS-MTOMPolicy verion 1.1.
+ */
+
 public class MTOM11Assertion extends MTOMAssertion {
 
     // creating a logger instance

Modified: webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java
(original)
+++ webservices/axis2/branches/java/1_5/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java
Fri Apr 17 15:34:43 2009
@@ -21,14 +21,33 @@
 
 import org.apache.neethi.Assertion;
 
+/**
+ * 
+ * This abstract class specifies the common features of a MTOM assertion. 
+ *
+ */
 public abstract class MTOMAssertion implements Assertion {
 
+	/** Specifies if the MTOM assertion is optional. The request can be MTOMised or non-MTOMised,</br>
+	 *  but the response will be MTOMised only if request is MTOMised. */
     protected boolean optional = false;
     
+    /**
+     * Checks if the MTOM assertion is optional. The request can be MTOMised or non-MTOMised,</br>
+	 * but the response will be MTOMised only if request is MTOMised.
+	 * 
+	 * @return <code>true</code> if the MTOM assertion is optional, otherwise returns
<code>false</code>.
+     */
     public boolean isOptional() {
         return optional;
     }
     
+    /**
+     * Sets the <code>optional</code> parameter.  
+     * 
+     * @param isOptional sets if the MTOM assertion is optional or not. If set to <code>true</code>
</br>
+     * then if the request is MTOMised then the response should be MTOMised, too.
+     */
     public void setOptional(boolean isOptional) {
         this.optional = isOptional;
     }

Modified: webservices/axis2/branches/java/1_5/modules/parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/parent/pom.xml?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/parent/pom.xml (original)
+++ webservices/axis2/branches/java/1_5/modules/parent/pom.xml Fri Apr 17 15:34:43 2009
@@ -88,6 +88,7 @@
         <mex.mar.version>1.5</mex.mar.version>
         <ping.mar.version>1.5</ping.mar.version>
         <scripting.mar.version>1.5</scripting.mar.version>
+        <mtompolicy.mar.version>1.5</mtompolicy.mar.version>
 
         <ant.version>1.7.0</ant.version>
         <antlr.version>2.7.7</antlr.version>

Modified: webservices/axis2/branches/java/1_5/modules/webapp/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/webapp/pom.xml?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/webapp/pom.xml (original)
+++ webservices/axis2/branches/java/1_5/modules/webapp/pom.xml Fri Apr 17 15:34:43 2009
@@ -1419,6 +1419,13 @@
                             </includes>
                         </resource>
                         <resource>
+                            <directory>${basedir}/../mtompolicy-mar/target</directory>
+                            <targetPath>WEB-INF/modules</targetPath>
+                            <includes>
+                                <include>*mtompolicy*.mar</include>
+                            </includes>
+                        </resource>
+                        <resource>
                             <directory>${basedir}/../samples/version/target</directory>
                             <targetPath>WEB-INF/services</targetPath>
                             <includes>

Modified: webservices/axis2/branches/java/1_5/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/pom.xml?rev=766054&r1=766053&r2=766054&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/pom.xml (original)
+++ webservices/axis2/branches/java/1_5/pom.xml Fri Apr 17 15:34:43 2009
@@ -46,6 +46,7 @@
         <module>modules/kernel</module>
         <module>modules/mex</module>
         <module>modules/mtompolicy</module>
+        <module>modules/mtompolicy-mar</module>
         <module>modules/parent</module>
         <module>modules/ping</module>
         <module>modules/samples/version</module>



Mime
View raw message