cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r889599 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ rt/management/src/main/java/org/apache/cxf/management/interceptor/ r...
Date Fri, 11 Dec 2009 12:55:39 GMT
Author: sergeyb
Date: Fri Dec 11 12:55:38 2009
New Revision: 889599

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

........
  r889595 | sergeyb | 2009-12-11 12:40:36 +0000 (Fri, 11 Dec 2009) | 1 line
  
  CXF-2541: minor update to the management interceptor for JAXRS operations be monitored too
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
    cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
    cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 12:55:38 2009
@@ -1 +1 @@
-/cxf/trunk:889426
+/cxf/trunk:889426,889595

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

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=889599&r1=889598&r2=889599&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
Fri Dec 11 12:55:38 2009
@@ -209,5 +209,7 @@
                                       MultivaluedMap<String, String> values) {
         message.getExchange().put(OperationResourceInfo.class, ori);
         message.put(URITemplate.TEMPLATE_PARAMETERS, values);
+        message.getExchange().put("org.apache.cxf.management.operation.name", 
+                                  ori.getMethodToInvoke().getName());
     }
 }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=889599&r1=889598&r2=889599&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Fri Dec 11 12:55:38 2009
@@ -119,6 +119,8 @@
     private Map<String, Object> cProperties;
     private Map<String, Object> uProperties;
     
+    private boolean skipJaxbChecks;
+    
     public void setContextProperties(Map<String, Object> contextProperties) {
         cProperties = contextProperties;
     }
@@ -390,7 +392,8 @@
     }
     
     protected boolean isSupported(Class<?> type, Type genericType, Annotation[] anns)
{
-        if (jaxbElementClassMap != null && jaxbElementClassMap.containsKey(type.getName()))
{
+        if (jaxbElementClassMap != null && jaxbElementClassMap.containsKey(type.getName())
+            || isSkipJaxbChecks()) {
             return true;
         }
         return type.getAnnotation(XmlRootElement.class) != null
@@ -646,6 +649,14 @@
         this.attributesToElements = value;
     }
 
+    public void setSkipJaxbChecks(boolean skipJaxbChecks) {
+        this.skipJaxbChecks = skipJaxbChecks;
+    }
+
+    public boolean isSkipJaxbChecks() {
+        return skipJaxbChecks;
+    }
+
     @XmlRootElement
     protected static class CollectionWrapper {
         

Modified: cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java?rev=889599&r1=889598&r2=889599&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
Fri Dec 11 12:55:38 2009
@@ -101,15 +101,23 @@
         if (null == cr) {
             LOG.log(Level.WARNING, "NO_COUNTER_REPOSITORY");
             return;
-        } else {            
+        } else {
             Service service = ex.get(Service.class);            
-            OperationInfo opInfo = ex.get(OperationInfo.class);
             Endpoint endpoint = ex.get(Endpoint.class);
             
             String serviceName = "\"" + service.getName() + "\"";            
             String portName = "\"" + endpoint.getEndpointInfo().getName().getLocalPart()
+ "\"";
+            
+            OperationInfo opInfo = ex.get(OperationInfo.class);
             String operationName = opInfo == null ? null : "\"" + opInfo.getName().getLocalPart()
+ "\"";
             
+            if (operationName == null) {
+                Object nameProperty = ex.get("org.apache.cxf.management.operation.name");
+                if (nameProperty != null) {
+                    operationName = "\"" + nameProperty.toString() + "\"";
+                }
+            }
+            
             StringBuilder buffer = new StringBuilder();
             buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME + ":");
             buffer.append(ManagementConstants.BUS_ID_PROP + "=" + bus.getId() + ",");

Modified: cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java?rev=889599&r1=889598&r2=889599&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTestBase.java
Fri Dec 11 12:55:38 2009
@@ -33,6 +33,7 @@
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.easymock.classextension.EasyMock;
+
 import org.junit.Assert;
 import org.junit.Before;
 
@@ -118,15 +119,14 @@
         EasyMock.expect(exchange.get(Endpoint.class)).andReturn(endpoint);
         EasyMock.replay(endpointInfo);
         EasyMock.replay(endpoint);
-        
+        setupOperationForMessage();
+    }
+      
+    protected void setupOperationForMessage() {
         OperationInfo op = EasyMock.createMock(OperationInfo.class);
         EasyMock.expect(op.getName()).andReturn(OPERATION_NAME);        
         EasyMock.expect(exchange.get(OperationInfo.class)).andReturn(op);
         EasyMock.replay(op);
-      
-        
     }
-      
-    
 
 }



Mime
View raw message