cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1327778 - /cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Date Thu, 19 Apr 2012 01:59:42 GMT
Author: ema
Date: Thu Apr 19 01:59:42 2012
New Revision: 1327778

URL: http://svn.apache.org/viewvc?rev=1327778&view=rev
Log:
[CXF-4247]:Add cache for not found wrapper class to avoid trying load them for many times

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=1327778&r1=1327777&r2=1327778&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Thu Apr 19 01:59:42 2012
@@ -24,7 +24,9 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Future;
 import java.util.logging.Level;
@@ -78,11 +80,15 @@ public class JaxWsServiceConfiguration e
      */
     private Map<Object, Class<?>> responseMethodClassCache;
     private Map<Object, Class<?>> requestMethodClassCache;
+    private List<Method> responseMethodClassNotFoundCache;
+    private List<Method> requestMethodClassNotFoundCache;
     private Map<Method, Annotation[][]> methodAnnotationCache;
     
     public JaxWsServiceConfiguration() {
         responseMethodClassCache = new HashMap<Object, Class<?>>();
         requestMethodClassCache = new HashMap<Object, Class<?>>();
+        responseMethodClassNotFoundCache = new ArrayList<Method>();
+        requestMethodClassNotFoundCache = new ArrayList<Method>();
         methodAnnotationCache = new HashMap<Method, Annotation[][]>();
     }
 
@@ -598,6 +604,9 @@ public class JaxWsServiceConfiguration e
     
     @Override
     public Class<?> getResponseWrapper(Method selected) {
+        if (this.responseMethodClassNotFoundCache.contains(selected)) {
+            return null;
+        }
         Class<?> cachedClass = responseMethodClassCache.get(selected);
         if (cachedClass != null) {
             return cachedClass;
@@ -635,7 +644,7 @@ public class JaxWsServiceConfiguration e
                 //do nothing, we will mock a schema for wrapper bean later on
             }
         }
-
+        responseMethodClassNotFoundCache.add(selected);
         return null;
     }
 
@@ -669,6 +678,9 @@ public class JaxWsServiceConfiguration e
     
     @Override
     public Class<?> getRequestWrapper(Method selected) {
+        if (this.requestMethodClassNotFoundCache.contains(selected)) {
+            return null;
+        }
         Class<?> cachedClass = requestMethodClassCache.get(selected);
         if (cachedClass != null) {
             return cachedClass;
@@ -703,7 +715,7 @@ public class JaxWsServiceConfiguration e
                 //do nothing, we will mock a schema for wrapper bean later on
             }
         }
-
+        requestMethodClassNotFoundCache.add(selected);
         return null;
     }
     



Mime
View raw message