You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2008/02/02 00:24:30 UTC

svn commit: r617704 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: context/AbstractContext.java description/AxisService.java

Author: scheu
Date: Fri Feb  1 15:24:23 2008
New Revision: 617704

URL: http://svn.apache.org/viewvc?rev=617704&view=rev
Log:
AXIS2-3490
Contributor: David Strite
Committer: Rich Scheuerle
AxisService.getOperationBySOAPAction: Reverse the order of the searches to improve performance
AbstractContext.getProperty: Don't call addPropertyDifferences if no value is found.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java?rev=617704&r1=617703&r2=617704&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java Fri Feb  1 15:24:23 2008
@@ -109,14 +109,13 @@
      */
     public Object getProperty(String key) {
         Object obj = properties == null ? null : properties.get(key);
-        if ((obj == null) && (parent != null)) {
-            obj = parent.getProperty(key);
-        } else {
-
-            // Assume that a property is which is read may be updated.
+        if (obj!=null) {
+            // Assume that a property which is read may be updated.
             // i.e. The object pointed to by 'value' may be modified after it is read
             addPropertyDifference(key, obj, false);
-        }
+        } else if (parent!=null) {
+            obj = parent.getProperty(key);
+        } 
         return obj;
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=617704&r1=617703&r2=617704&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java Fri Feb  1 15:24:23 2008
@@ -1395,12 +1395,15 @@
      *         SOAP Action otherwise will return null.
      */
     public AxisOperation getOperationBySOAPAction(String soapAction) {
+        
+        // Check for illegal soapActions
         if ((soapAction == null) || soapAction.length() == 0) {
         	if(log.isDebugEnabled()){
         		log.debug("getOperationBySOAPAction: "+soapAction +" is null or ''. Returning null.");
         	}
             return null;
         }
+        
         // If the action maps to an alais that is not unique, then it can't be used to map to 
         // an operation.
         if (invalidOperationsAliases.contains(soapAction)) {
@@ -1410,7 +1413,18 @@
             return null;
         }
 
-        AxisOperation operation = null;
+        // Get the operation from the action->operation map
+        AxisOperation operation = (AxisOperation) operationsAliasesMap.get(soapAction);
+        
+        if (operation != null) {
+            if(log.isDebugEnabled()){
+                log.debug("getOperationBySOAPAction: Operation ("+operation+","+operation.getName()+") for soapAction: "+soapAction+" found in action map.");
+            }
+            return operation;
+        }
+        
+        // The final fallback is to check the operations for a matching name.
+        
         Iterator children = getChildren();
         // I could not find any spec statement that explicitly forbids using a short name in the SOAPAction header or wsa:Action element,
         // so I believe this to be valid.  There may be customers using the shortname as the SOAPAction in their client code that would
@@ -1426,10 +1440,7 @@
         	if(log.isDebugEnabled()){
         		log.debug("getOperationBySOAPAction: Operation ("+operation+","+operation.getName()+") for soapAction: "+soapAction+" found as child.");
         	}
-            return operation;
         }
-
-        operation = (AxisOperation) operationsAliasesMap.get(soapAction);
         
         return operation;
     }



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