cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1073385 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs: client/JAXRSClientFactory.java interceptor/JAXRSOutInterceptor.java
Date Tue, 22 Feb 2011 16:24:58 GMT
Author: sergeyb
Date: Tue Feb 22 16:24:57 2011
New Revision: 1073385

URL: http://svn.apache.org/viewvc?rev=1073385&view=rev
Log:
JAX-RS: minimize the excessive logging in case of client models

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java?rev=1073385&r1=1073384&r2=1073385&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java
Tue Feb 22 16:24:57 2011
@@ -184,9 +184,10 @@ public final class JAXRSClientFactory {
      */
     public static <T> T createFromModel(String baseAddress, Class<T> cls, String
modelRef, 
                                List<?> providers, String configLocation) {
-        JAXRSClientFactoryBean bean = getBean(baseAddress, cls, configLocation);
+        JAXRSClientFactoryBean bean = WebClient.getBean(baseAddress, configLocation);
         bean.setProviders(providers);
         bean.setModelRef(modelRef);
+        bean.setServiceClass(cls);
         return bean.create(cls);
     }
     
@@ -201,9 +202,10 @@ public final class JAXRSClientFactory {
      */
     public static <T> T createFromModel(String baseAddress, Class<T> cls, String
modelRef, 
                                         List<?> providers, boolean threadSafe) {
-        JAXRSClientFactoryBean bean = getBean(baseAddress, cls, null);
+        JAXRSClientFactoryBean bean = WebClient.getBean(baseAddress, null);
         bean.setProviders(providers);
         bean.setModelRef(modelRef);
+        bean.setServiceClass(cls);
         if (threadSafe) {
             bean.setInitialState(new ThreadLocalClientState(baseAddress));
         }
@@ -232,9 +234,11 @@ public final class JAXRSClientFactory {
      */
     public static <T> T createFromModel(String baseAddress, Class<T> cls, List<UserResource>
modelBeans,
                                List<?> providers, String configLocation) {
-        JAXRSClientFactoryBean bean = getBean(baseAddress, cls, configLocation);
+        JAXRSClientFactoryBean bean = WebClient.getBean(baseAddress, configLocation);
+        
         bean.setProviders(providers);
         bean.setModelBeans(modelBeans);
+        bean.setServiceClass(cls);
         return bean.create(cls);
     }
     

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=1073385&r1=1073384&r2=1073385&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
Tue Feb 22 16:24:57 2011
@@ -31,6 +31,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.servlet.http.HttpServletResponse;
@@ -237,7 +238,9 @@ public class JAXRSOutInterceptor extends
         Object entity = getEntity(responseObj);
         try {
             responseType = checkFinalContentType(responseType);
-            LOG.fine("Response content type is: " + responseType.toString());
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("Response content type is: " + responseType.toString());
+            }
             message.put(Message.CONTENT_TYPE, responseType.toString());
             
             long size = writer.getSize(entity, targetType, genericType, annotations, responseType);
@@ -246,8 +249,9 @@ public class JAXRSOutInterceptor extends
                          + writer.getClass().getName());
                 responseHeaders.putSingle(HttpHeaders.CONTENT_LENGTH, Long.toString(size));
             }
-            
-            LOG.fine("Response EntityProvider is: " + writer.getClass().getName());
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("Response EntityProvider is: " + writer.getClass().getName());
+            }
             try {
                 writer.writeTo(entity, targetType, genericType, 
                                annotations, 



Mime
View raw message