cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r760154 - in /cxf/branches/2.1.x-fixes: ./ maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ rt/core/src/main/java/org/apache/cxf/interceptor/
Date Mon, 30 Mar 2009 20:24:27 GMT
Author: dkulp
Date: Mon Mar 30 20:24:27 2009
New Revision: 760154

URL: http://svn.apache.org/viewvc?rev=760154&view=rev
Log:
Merged revisions 760150 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r760150 | dkulp | 2009-03-30 16:21:31 -0400 (Mon, 30 Mar 2009) | 3 lines
  
  Throw an ID into the logging stuff to make it easier to correlate the request/response in
the logs
  Also throw the incoming URI on server side to know which service it's going to
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar 30 20:24:27 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,759961,759963-759964,759966,760029,760073
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,759961,759963-759964,759966,760029,760073,760150

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java?rev=760154&r1=760153&r2=760154&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java
(original)
+++ cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java
Mon Mar 30 20:24:27 2009
@@ -29,11 +29,6 @@
 import org.apache.cxf.helpers.FileUtils;
 import org.apache.maven.plugin.MojoExecutionException;
 
-/**
-   This class was ported from fAnt wsdl2java task
-   http://code.google.com/p/fant/
- */
-
 public final class WsdlOptionLoader {
     private static final String WSDL_OPTIONS = "-options$";
     private static final String WSDL_BINDINGS = "-binding-?\\d*.xml$";

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java?rev=760154&r1=760153&r2=760154&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
Mon Mar 30 20:24:27 2009
@@ -84,7 +84,13 @@
     }
 
     private void logging(Message message) throws Fault {
-        final LoggingMessage buffer = new LoggingMessage("Inbound Message\n----------------------------");
+        String id = (String)message.getExchange().get(LoggingMessage.ID_KEY);
+        if (id == null) {
+            id = LoggingMessage.nextId();
+            message.getExchange().put(LoggingMessage.ID_KEY, id);
+        }
+        final LoggingMessage buffer 
+            = new LoggingMessage("Inbound Message\n----------------------------", id);
 
         
         String encoding = (String)message.get(Message.ENCODING);
@@ -92,11 +98,19 @@
         if (encoding != null) {
             buffer.getEncoding().append(encoding);
         }
+        String ct = (String)message.get(Message.CONTENT_TYPE);
+        if (ct != null) {
+            buffer.getContentType().append(ct);
+        }
         Object headers = message.get(Message.PROTOCOL_HEADERS);
 
         if (headers != null) {
             buffer.getHeader().append(headers);
         }
+        String uri = (String)message.get(Message.REQUEST_URI);
+        if (uri != null) {
+            buffer.getAddress().append(uri);
+        }
             
         InputStream is = message.getContent(InputStream.class);
         if (is != null) {

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java?rev=760154&r1=760153&r2=760154&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
Mon Mar 30 20:24:27 2009
@@ -18,23 +18,42 @@
  */
 package org.apache.cxf.interceptor;
 
-public final class LoggingMessage {
+import java.util.concurrent.atomic.AtomicInteger;
 
+public final class LoggingMessage {
+    public static final String ID_KEY = LoggingMessage.class.getName() + ".ID";
+    private static final AtomicInteger ID = new AtomicInteger();
+    
     private final String heading;
-
+    private final StringBuilder address;
+    private final StringBuilder contentType;
     private final StringBuilder encoding;
     private final StringBuilder header;
     private final StringBuilder message;
     private final StringBuilder payload;
+    private final String id;
+    
 
-    public LoggingMessage(String h) {
+    public LoggingMessage(String h, String i) {
         heading = h;
+        id = i;
 
+        contentType = new StringBuilder();
+        address = new StringBuilder();
         encoding = new StringBuilder();
         header = new StringBuilder();
         message = new StringBuilder();
         payload = new StringBuilder();
     }
+    
+    public static String nextId() {
+        return Integer.toString(ID.incrementAndGet());
+    }
+        
+    
+    public StringBuilder getAddress() {
+        return address;
+    }
 
     public StringBuilder getEncoding() {
         return encoding;
@@ -44,6 +63,10 @@
         return header;
     }
 
+    public StringBuilder getContentType() {
+        return contentType;
+    }
+
     public StringBuilder getMessage() {
         return message;
     }
@@ -55,8 +78,15 @@
     public String toString() {
         StringBuilder buffer = new StringBuilder();
         buffer.append(heading);
+        buffer.append("\nID: ").append(id);
+        if (address.length() > 0) {
+            buffer.append("\nAddress: ");
+            buffer.append(address);
+        }
         buffer.append("\nEncoding: ");
         buffer.append(encoding);
+        buffer.append("\nContent-Type: ");
+        buffer.append(contentType);
         buffer.append("\nHeaders: ");
         buffer.append(header);
         if (message.length() > 0) {

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java?rev=760154&r1=760153&r2=760154&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
Mon Mar 30 20:24:27 2009
@@ -108,7 +108,14 @@
         }
         
         public void onClose(CachedOutputStream cos) {
-            final LoggingMessage buffer = new LoggingMessage("Outbound Message\n---------------------------");
+            String id = (String)message.getExchange().get(LoggingMessage.ID_KEY);
+            if (id == null) {
+                id = LoggingMessage.nextId();
+                message.getExchange().put(LoggingMessage.ID_KEY, id);
+            }
+            final LoggingMessage buffer 
+                = new LoggingMessage("Outbound Message\n---------------------------",
+                                     id);
             
             String encoding = (String)message.get(Message.ENCODING);
 
@@ -116,8 +123,15 @@
                 buffer.getEncoding().append(encoding);
             }            
             
+            String address = (String)message.get(Message.ENDPOINT_ADDRESS);
+            if (address != null) {
+                buffer.getAddress().append(address);
+            }
+            String ct = (String)message.get(Message.CONTENT_TYPE);
+            if (ct != null) {
+                buffer.getContentType().append(ct);
+            }
             Object headers = message.get(Message.PROTOCOL_HEADERS);
-
             if (headers != null) {
                 buffer.getHeader().append(headers);
             }



Mime
View raw message