axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r527202 - in /webservices/axis2/trunk/java/modules: jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/ jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/ jaxws/src/org/apache/axis2/jaxws/server/ jaxws/src/org/apache/axis2...
Date Tue, 10 Apr 2007 17:03:27 GMT
Author: scheu
Date: Tue Apr 10 10:03:24 2007
New Revision: 527202

URL: http://svn.apache.org/viewvc?view=rev&rev=527202
Log:
AXIS2-2493
Contributor:Rich Scheuerle
Performance Low Hanging Fruit from IBM performance analysis.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?view=diff&rev=527202&r1=527201&r2=527202
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
Tue Apr 10 10:03:24 2007
@@ -875,8 +875,7 @@
     static <T> Holder<T> createHolder(Class paramType, T value)
             throws IllegalAccessException, InstantiationException, ClassNotFoundException
{
         if (Holder.class.isAssignableFrom(paramType)) {
-            Class holderClazz = loadClass(paramType.getName());
-            Holder<T> holder = (Holder<T>)holderClazz.newInstance();
+            Holder holder = (Holder) paramType.newInstance();
             holder.value = value;
             return holder;
         }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java?view=diff&rev=527202&r1=527201&r2=527202
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java
Tue Apr 10 10:03:24 2007
@@ -49,6 +49,7 @@
 import java.net.URL;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.Collection;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -94,10 +95,10 @@
         //read wsdlLocation from @WebService Annotation.
         ServiceDescriptionWSDL sdw = (ServiceDescriptionWSDL)serviceDesc;
         Definition wsdlDefinition = sdw.getWSDLDefinition();
-        EndpointDescription[] endpointDescs = serviceDesc.getEndpointDescriptions();
+        Collection<EndpointDescription> endpointDescs = serviceDesc.getEndpointDescriptions_AsCollection();
         if (endpointDescs != null) {
-            for (int i = 0; i < endpointDescs.length; i++) {
-                EndpointDescription ed = (EndpointDescription)endpointDescs[i];
+            for (EndpointDescription ed:endpointDescs) {
+
                 if (wsdlDefinition == null) {
                     // TODO I don't think we should be trying to load the wsdlDefinition
here.
 
@@ -131,12 +132,12 @@
     public static TreeSet<String> getPackagesFromAnnotations(ServiceDescription serviceDesc,
                                                              MarshalServiceRuntimeDescription
msrd) {
         TreeSet<String> set = new TreeSet<String>();
-        EndpointDescription[] endpointDescs = serviceDesc.getEndpointDescriptions();
-
+        Collection<EndpointDescription> endpointDescs = serviceDesc.getEndpointDescriptions_AsCollection();
+        
         // Build a set of packages from all of the endpoints
         if (endpointDescs != null) {
-            for (int i = 0; i < endpointDescs.length; i++) {
-                set.addAll(getPackagesFromAnnotations(endpointDescs[i], msrd));
+            for (EndpointDescription endpointDesc: endpointDescs) {
+                set.addAll(getPackagesFromAnnotations(endpointDesc, msrd));
             }
         }
         return set;

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java?view=diff&rev=527202&r1=527201&r2=527202
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java
Tue Apr 10 10:03:24 2007
@@ -32,6 +32,7 @@
 
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -54,21 +55,26 @@
      * @param ap                 ArtifactProcessor which found the artifact classes
      * @return PropertyDescriptor Map
      */
-    public static Map<Class, Map<String, PropertyDescriptorPlus>> getPropertyDescMaps(
+    /**
+     * @param serviceDescription ServiceDescription
+     * @param ap ArtifactProcessor which found the artifact classes
+     * @return PropertyDescriptor Map
+     */
+    public static Map<Class,Map<String, PropertyDescriptorPlus>> getPropertyDescMaps(
             ServiceDescription serviceDesc,
             ArtifactProcessor ap) {
-        Map<Class, Map<String, PropertyDescriptorPlus>> map =
-                new HashMap<Class, Map<String, PropertyDescriptorPlus>>();
-        EndpointDescription[] endpointDescs = serviceDesc.getEndpointDescriptions();
-
+        Map<Class,Map<String, PropertyDescriptorPlus>> map = new HashMap<Class,Map<String,
PropertyDescriptorPlus>>();
+        Collection<EndpointDescription> endpointDescs = serviceDesc.getEndpointDescriptions_AsCollection();
+        
         // Build a set of packages from all of the endpoints
         if (endpointDescs != null) {
-            for (int i = 0; i < endpointDescs.length; i++) {
-                getPropertyDescMaps(endpointDescs[i], ap, map);
+            for (EndpointDescription ed:endpointDescs) {
+                getPropertyDescMaps(ed, ap, map);
             }
         }
         return map;
     }
+
 
 
     /**

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java?view=diff&rev=527202&r1=527201&r2=527202
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
Tue Apr 10 10:03:24 2007
@@ -57,6 +57,7 @@
 import java.io.StringReader;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.Collection;
 
 /**
  * The EndpointController is the server side equivalent to the InvocationController on the
client
@@ -292,11 +293,12 @@
     private boolean bindingTypesMatch(MessageContext requestMsgCtx,
                                       ServiceDescription serviceDesc) {
         // compare soap versions and respond appropriately under SOAP 1.2 Appendix 'A'
-        EndpointDescription[] eds = serviceDesc.getEndpointDescriptions();
+        Collection<EndpointDescription> eds = serviceDesc.getEndpointDescriptions_AsCollection();
         // dispatch endpoints do not have SEIs, so watch out for null or empty array
-        if ((eds != null) && (eds.length > 0)) {
+        if ((eds != null) && (eds.size() > 0)) {
+            EndpointDescription ed = eds.iterator().next();
             Protocol protocol = requestMsgCtx.getMessage().getProtocol();
-            String endpointBindingType = eds[0].getBindingType();
+            String endpointBindingType = ed.getBindingType();
             if (protocol.equals(Protocol.soap11)) {
                 return (SOAPBinding.SOAP11HTTP_BINDING.equalsIgnoreCase(endpointBindingType))
||
                         (SOAPBinding.SOAP11HTTP_MTOM_BINDING.equalsIgnoreCase(endpointBindingType));

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java?view=diff&rev=527202&r1=527201&r2=527202
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
Tue Apr 10 10:03:24 2007
@@ -189,19 +189,6 @@
         return op;
     }
 
-    /*
-    private ServiceDescription getServiceDescription(MessageContext mc){
-        return mc.getServiceDescription();
-    }
-
-    private EndpointDescription getEndpointDescription(MessageContext mc){
-        ServiceDescription sd = mc.getServiceDescription();
-        EndpointDescription[] eds = sd.getEndpointDescriptions();
-        EndpointDescription ed = eds[0];
-        return ed;
-    }
-    */
-
     private MethodMarshaller getMethodMarshaller(Protocol protocol,
                                                  OperationDescription operationDesc) {
         javax.jws.soap.SOAPBinding.Style styleOnSEI =

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java?view=diff&rev=527202&r1=527201&r2=527202
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java
Tue Apr 10 10:03:24 2007
@@ -136,9 +136,9 @@
     static boolean isHolderType(String checkType) {
         boolean isHolder = false;
         if (checkType != null) {
-            String rawType = getRawType(checkType);
-            if (rawType != null && rawType.equals(JAXWS_HOLDER_CLASS)) {
-                isHolder = true;
+            if (checkType.startsWith(JAXWS_HOLDER_CLASS)) {
+                isHolder = checkType.length() == JAXWS_HOLDER_CLASS.length() ||
+                           checkType.charAt(JAXWS_HOLDER_CLASS.length()) == '<';
             }
         }
         return isHolder;

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?view=diff&rev=527202&r1=527201&r2=527202
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
Tue Apr 10 10:03:24 2007
@@ -1173,8 +1173,8 @@
         // Go through the list of Endpoints that have been created and add any
         // not already in the list.  This will include ports added to the Service
         // via getPort(...) and addPort(...)
-        EndpointDescription[] endpointDescArray = getEndpointDescriptions();
-        for (EndpointDescription endpointDesc : endpointDescArray) {
+        Collection<EndpointDescription> endpointDescs = getEndpointDescriptions_AsCollection();
+        for (EndpointDescription endpointDesc : endpointDescs) {
             QName endpointPortQName = endpointDesc.getPortQName();
             if (!portList.contains(endpointPortQName)) {
                 portList.add(endpointPortQName);
@@ -1272,11 +1272,12 @@
             // string.append("ConfigurationContext: " + getAxisConfigContext());
             // EndpointDescriptions
             string.append(newline);
-            EndpointDescription[] endpointDescs = getEndpointDescriptions();
+            Collection<EndpointDescription> endpointDescs = getEndpointDescriptions_AsCollection();
             if (endpointDescs == null) {
                 string.append("EndpointDescription array is null");
-            } else {
-                string.append("Number of EndpointDescrptions: " + endpointDescs.length);
+            }
+            else {
+                string.append("Number of EndpointDescrptions: " + endpointDescs.size());
                 string.append(newline);
                 for (EndpointDescription endpointDesc : endpointDescs) {
                     string.append(endpointDesc.toString());

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java?view=diff&rev=527202&r1=527201&r2=527202
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java
(original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java
Tue Apr 10 10:03:24 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.axis2.jaxws.description.validator;
 
+import java.util.Collection;
+
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.description.ServiceDescription;
 import org.apache.axis2.jaxws.description.ServiceDescriptionJava;
@@ -60,10 +62,10 @@
     private boolean validateEndpointDescriptions() {
         boolean areAllValid = true;
         // Validate all the Endpoints that were created under this Service Description
-        EndpointDescription[] endpointDescArray = serviceDesc.getEndpointDescriptions();
-        for (EndpointDescription endpointDesc : endpointDescArray) {
-            EndpointDescriptionValidator endpointValidator =
-                    new EndpointDescriptionValidator(endpointDesc);
+        Collection<EndpointDescription> endpointDescs = serviceDesc.getEndpointDescriptions_AsCollection();
+        for (EndpointDescription endpointDesc:endpointDescs) {
+            EndpointDescriptionValidator endpointValidator = new EndpointDescriptionValidator(endpointDesc);
+
             boolean isEndpointValid = endpointValidator.validate();
             if (!isEndpointValid) {
                 addValidationFailure(endpointValidator, "Endpoint failed validation");



---------------------------------------------------------------------
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