cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1454397 - in /cxf/branches/2.6.x-fixes: ./ rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
Date Fri, 08 Mar 2013 14:13:53 GMT
Author: sergeyb
Date: Fri Mar  8 14:13:53 2013
New Revision: 1454397

URL: http://svn.apache.org/r1454397
Log:
Merged revisions 1454393 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1454393 | sergeyb | 2013-03-08 14:09:49 +0000 (Fri, 08 Mar 2013) | 9 lines
  
  Merged revisions 1454391 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1454391 | sergeyb | 2013-03-08 14:06:02 +0000 (Fri, 08 Mar 2013) | 1 line
    
    [CXF-4873] Escape the MBean ObjectName question mark pattern char in the counter interceptor
operation name value if it comes as a message property
  ........
................

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1454393
  Merged /cxf/trunk:r1454391

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

Modified: cxf/branches/2.6.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java?rev=1454397&r1=1454396&r2=1454397&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
Fri Mar  8 14:13:53 2013
@@ -41,6 +41,8 @@ import org.apache.cxf.service.model.Oper
 
 public abstract class AbstractMessageResponseTimeInterceptor extends AbstractPhaseInterceptor<Message>
{
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractMessageResponseTimeInterceptor.class);
+    private static final String QUESTION_MARK = "?";
+    private static final String ESCAPED_QUESTION_MARK = "\\?";
     
     AbstractMessageResponseTimeInterceptor(String phase) {
         super(phase);
@@ -114,7 +116,7 @@ public abstract class AbstractMessageRes
             if (operationName == null) {
                 Object nameProperty = ex.get("org.apache.cxf.resource.operation.name");
                 if (nameProperty != null) {
-                    operationName = "\"" + nameProperty.toString() + "\"";
+                    operationName = "\"" + escapePatternChars(nameProperty.toString()) +
"\"";
                 }
             }
             
@@ -147,4 +149,11 @@ public abstract class AbstractMessageRes
         }
     }
         
+    protected String escapePatternChars(String value) {  
+        // This can be replaced if really needed with pattern-based matching
+        if (value.lastIndexOf(QUESTION_MARK) != -1) {
+            value.replace(QUESTION_MARK, ESCAPED_QUESTION_MARK);
+        }
+        return value;
+    }
 }



Mime
View raw message