cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r752992 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/common/util/ common/common/src/main/java/org/apache/cxf/resource/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/frontend/simple/src/main/java/org/apache/cxf/service/facto...
Date Thu, 12 Mar 2009 20:10:29 GMT
Author: dkulp
Date: Thu Mar 12 20:10:28 2009
New Revision: 752992

URL: http://svn.apache.org/viewvc?rev=752992&view=rev
Log:
[CXF-2110] First part of patch from Alessio Soldano applied for adding parameterOrder
[CXF-2081] Add an -J-Xmx flag to forked javac (patch from Torsten Mielke)
[CXF-2069] Unformatted service list (patch from Ted Leung applied)
[CXF-2087] If the baseUri is empty, skip doing some stuff that won't work anyway
[CXF-2084] Make AbstractMessageResponseTimeInterceptor constructor public

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java?rev=752992&r1=752991&r2=752992&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java Thu Mar
12 20:10:28 2009
@@ -58,6 +58,9 @@
         // This code doesn't honor java.home
         // list.add("javac");
 
+        //fix for CXF-2081, set maximum heap of this VM to javac.
+        list.add("-J-Xmx" + Runtime.getRuntime().maxMemory());
+
         if (outputDir != null) {
             list.add("-d");
             list.add(outputDir.getAbsolutePath().replace(File.pathSeparatorChar, '/'));

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?rev=752992&r1=752991&r2=752992&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java Thu Mar
12 20:10:28 2009
@@ -37,6 +37,7 @@
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.Base64Utility;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.helpers.LoadingByteArrayOutputStream;
 
@@ -151,7 +152,7 @@
                 } catch (ClassCastException ex) {
                     is = url.openStream();
                 }
-            } else if (baseUriStr != null) {
+            } else if (!StringUtils.isEmpty(baseUriStr)) {
                 URI base;
                 File baseFile = new File(baseUriStr);
 
@@ -184,6 +185,9 @@
                     tryClasspath(base.toString().startsWith("file:") 
                                  ? base.toString().substring(5) : base.toString());
                 }
+            } else {
+                tryClasspath(uriStr.startsWith("file:") 
+                             ? uriStr.substring(5) : uriStr);
             }
         } catch (URISyntaxException e) {
             // do nothing

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java?rev=752992&r1=752991&r2=752992&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java Thu Mar
12 20:10:28 2009
@@ -533,6 +533,7 @@
                 this.addExtensibilityAttributes(input, getInputExtensionAttributes(operationInfo));
                 input.setMessage(message);
                 operation.setInput(input);
+                operation.setParameterOrdering(operationInfo.getParameterOrdering());
                 
                 if (operationInfo.getOutput() != null) {
                     Output output = def.createOutput();

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=752992&r1=752991&r2=752992&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Thu Mar 12 20:10:28 2009
@@ -36,6 +36,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -1302,8 +1303,7 @@
             }
             if (isInParam(method, j)) {
                 final QName q = getInParameterName(op, method, j);
-                final QName q2 = getInPartName(op, method, j);
-                MessagePartInfo part = inMsg.addMessagePart(q2);
+                MessagePartInfo part = inMsg.addMessagePart(getInPartName(op, method, j));
                 initializeParameter(part, paramClasses[j], method.getGenericParameterTypes()[j]);
                 //TODO:remove method param annotations
                 part.setProperty(METHOD_PARAM_ANNOTATIONS, method.getParameterAnnotations());
@@ -1398,11 +1398,40 @@
                     }
                 }
             }
-
         }
+        
+        //setting the parameterOrder that
+        //allows preservation of method signatures
+        //when doing java->wsdl->java
+        setParameterOrder(method, paramClasses, op);
 
         initializeFaults(intf, op, method);
     }
+    
+    private void setParameterOrder(Method method, Class[] paramClasses, OperationInfo op)
{
+        if (isRPC(method)) {
+            List<String> paramOrdering = new LinkedList<String>();
+            boolean hasOut = false;
+            for (int j = 0; j < paramClasses.length; j++) {
+                if (Exchange.class.equals(paramClasses[j])) {
+                    continue;
+                }
+                if (isInParam(method, j)) {
+                    paramOrdering.add(getInPartName(op, method, j).getLocalPart());
+                    if (isOutParam(method, j)) {
+                        hasOut = true;
+                    }
+                } else if (isOutParam(method, j)) {
+                    hasOut = true;
+                    paramOrdering.add(getOutPartName(op, method, j).getLocalPart());
+                }
+            }
+            if (!paramOrdering.isEmpty() && hasOut) {
+                op.setParameterOrdering(paramOrdering);
+            }
+        }
+    }
+    
 
     protected void createInputWrappedMessageParts(OperationInfo op, Method method, MessageInfo
inMsg) {
         MessagePartInfo part = inMsg.addMessagePart("parameters");

Modified: cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java?rev=752992&r1=752991&r2=752992&view=diff
==============================================================================
--- cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
(original)
+++ cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
Thu Mar 12 20:10:28 2009
@@ -41,7 +41,7 @@
 public abstract class AbstractMessageResponseTimeInterceptor extends AbstractPhaseInterceptor<Message>
{
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractMessageResponseTimeInterceptor.class);
     
-    AbstractMessageResponseTimeInterceptor(String phase) {
+    public AbstractMessageResponseTimeInterceptor(String phase) {
         super(phase);
     }
     

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?rev=752992&r1=752991&r2=752992&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Thu Mar 12 20:10:28 2009
@@ -126,7 +126,14 @@
                     || StringUtils.isEmpty(request.getPathInfo())
                     || "/".equals(request.getPathInfo())) {
                     updateDests(request);
-                    generateServiceList(request, res);
+                    
+                    if (request.getParameter("stylesheet") != null) {
+                        renderStyleSheet(request, res);
+                    } else if ("false".equals(request.getParameter("formatted"))) {
+                        generateUnformattedServiceList(request, res);
+                    } else {
+                        generateServiceList(request, res);
+                    }
                 } else {
                     d = checkRestfulRequest(request);
                     if (d == null || d.getMessageObserver() == null) {                  
     
@@ -196,16 +203,7 @@
     }
     
     protected void generateServiceList(HttpServletRequest request, HttpServletResponse response)
-        throws IOException {
-        
-        if (request.getParameter("stylesheet") != null) {
-            URL url = this.getClass().getResource("servicelist.css");
-            if (url != null) {
-                IOUtils.copy(url.openStream(), response.getOutputStream());
-            }
-            return;
-        }
-        
+        throws IOException {        
         response.setContentType("text/html; charset=UTF-8");        
         
         response.getWriter().write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
" 
@@ -224,15 +222,7 @@
         response.getWriter().write("<title>CXF - Service list</title>");
         response.getWriter().write("</head><body>");
         if (!isHideServiceList) {
-            List<ServletDestination> destinations 
-                = new LinkedList<ServletDestination>(transport.getDestinations());
-            Collections.sort(destinations, new Comparator<ServletDestination>() {
-                public int compare(ServletDestination o1, ServletDestination o2) {
-                    return o1.getEndpointInfo().getInterface().getName()
-                         .getLocalPart().compareTo(o2.getEndpointInfo()
-                                                       .getInterface().getName().getLocalPart());
-                }
-            });
+            List<ServletDestination> destinations = getServletDestinations();
                 
             if (destinations.size() > 0) {  
                 response.getWriter().write("<span class=\"heading\">Available services:</span><br/>");
@@ -271,6 +261,46 @@
         response.getWriter().write("</body></html>");
     }
 
+    private void renderStyleSheet(HttpServletRequest request,
+            HttpServletResponse response) throws IOException {
+        response.setContentType("text/css; charset=UTF-8");
+
+        URL url = this.getClass().getResource("servicelist.css");
+        if (url != null) {
+            IOUtils.copy(url.openStream(), response.getOutputStream());
+        }
+    }
+
+    private List<ServletDestination> getServletDestinations() {
+        List<ServletDestination> destinations = new LinkedList<ServletDestination>(
+                transport.getDestinations());
+        Collections.sort(destinations, new Comparator<ServletDestination>() {
+            public int compare(ServletDestination o1, ServletDestination o2) {
+                return o1.getEndpointInfo().getInterface().getName()
+                        .getLocalPart().compareTo(
+                                o2.getEndpointInfo().getInterface().getName()
+                                        .getLocalPart());
+            }
+        });
+
+        return destinations;
+    }
+
+    protected void generateUnformattedServiceList(HttpServletRequest request,
+            HttpServletResponse response) throws IOException {
+        response.setContentType("text/plain; charset=UTF-8");
+
+        if (!isHideServiceList) {
+            List<ServletDestination> destinations = getServletDestinations();
+
+            for (ServletDestination sd : destinations) {
+                String address = sd.getEndpointInfo().getAddress();
+                response.getWriter().write(address);
+                response.getWriter().write('\n');
+            }
+        }
+    }
+    
     private String getBaseURL(HttpServletRequest request) {
         String reqPrefix = request.getRequestURL().toString();        
         String pathInfo = request.getPathInfo() == null ? "" : request.getPathInfo();

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java?rev=752992&r1=752991&r2=752992&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java Thu Mar
12 20:10:28 2009
@@ -42,6 +42,9 @@
     public void compile(ToolContext context) throws ToolException {        
         List<String> argList = new ArrayList<String>();
         
+        //fix for CXF-2081, set maximum heap of current VM to javac.
+        argList.add("-J-Xmx" + Runtime.getRuntime().maxMemory());
+
         String javaClasspath = System.getProperty("java.class.path");
         // hard code cxf.jar
         boolean classpathSetted = javaClasspath != null ? true : false;



Mime
View raw message