cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r1457908 - in /cxf/trunk: api/src/main/java/org/apache/cxf/workqueue/ api/src/main/java/org/apache/cxf/wsdl/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/
Date Mon, 18 Mar 2013 18:36:36 GMT
Author: asoldano
Date: Mon Mar 18 18:36:35 2013
New Revision: 1457908

URL: http://svn.apache.org/r1457908
Log:
Few more optimizations (check log level before building up / concatenating strings for FINE
or lower log level messages)

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
    cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java?rev=1457908&r1=1457907&r2=1457908&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java Mon Mar
18 18:36:35 2013
@@ -172,13 +172,15 @@ public class AutomaticWorkQueueImpl impl
             };
             
                     
-            StringBuilder buf = new StringBuilder();
-            buf.append("Constructing automatic work queue with:\n");
-            buf.append("max queue size: " + maxQueueSize + "\n");
-            buf.append("initialThreads: " + initialThreads + "\n");
-            buf.append("lowWaterMark: " + lowWaterMark + "\n");
-            buf.append("highWaterMark: " + highWaterMark + "\n");
-            LOG.fine(buf.toString());
+            if (LOG.isLoggable(Level.FINE)) {
+                StringBuilder buf = new StringBuilder();
+                buf.append("Constructing automatic work queue with:\n");
+                buf.append("max queue size: " + maxQueueSize + "\n");
+                buf.append("initialThreads: " + initialThreads + "\n");
+                buf.append("lowWaterMark: " + lowWaterMark + "\n");
+                buf.append("highWaterMark: " + highWaterMark + "\n");
+                LOG.fine(buf.toString());
+            }
     
             if (initialThreads > highWaterMark) {
                 initialThreads = highWaterMark;

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java?rev=1457908&r1=1457907&r2=1457908&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java Mon Mar 18
18:36:35 2013
@@ -770,7 +770,9 @@ public final class EndpointReferenceUtil
                 if (jaxbVal instanceof ServiceNameType) {
                     Port port = null;
                     ServiceNameType snt = (ServiceNameType)jaxbVal;
-                    LOG.log(Level.FINEST, "found service name " + snt.getValue().getLocalPart());
+                    if (LOG.isLoggable(Level.FINEST)) {
+                        LOG.log(Level.FINEST, "found service name " + snt.getValue().getLocalPart());
+                    }
                     Service service = def.getService(snt.getValue());
                     if (service == null) {
                         LOG.log(Level.WARNING, "can't find the service name ["

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=1457908&r1=1457907&r2=1457908&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Mon Mar
18 18:36:35 2013
@@ -494,7 +494,9 @@ public class WSDLServiceBuilder {
             copyExtensionAttributes(bi, binding);
 
             for (BindingOperation bop : cast(binding.getBindingOperations(), BindingOperation.class))
{
-                LOG.finer("binding operation name is " + bop.getName());
+                if (LOG.isLoggable(Level.FINER)) {
+                    LOG.finer("binding operation name is " + bop.getName());
+                }
                 String inName = null;
                 String outName = null;
                 if (bop.getBindingInput() != null) {

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=1457908&r1=1457907&r2=1457908&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Mon
Mar 18 18:36:35 2013
@@ -21,6 +21,7 @@ package org.apache.cxf.ws.policy;
 
 import java.util.*;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.annotation.Resource;
@@ -565,6 +566,7 @@ public class PolicyEngineImpl implements
                                        Assertor assertor) {
         PolicyInterceptorProviderRegistry pipr = 
             bus.getExtension(PolicyInterceptorProviderRegistry.class);
+        final boolean doLog = LOG.isLoggable(Level.FINE);
         for (PolicyComponent pc : alternative) {
             if (pc instanceof Assertion) {
                 Assertion a = (Assertion)pc;
@@ -572,7 +574,9 @@ public class PolicyEngineImpl implements
                     || !pipr.get(a.getName()).isEmpty() 
                     || (null != assertor && assertor.canAssert(a.getName())))) {
                 
-                    LOG.fine("Alternative " + a.getName() + " is not supported");
+                    if (doLog) {
+                        LOG.fine("Alternative " + a.getName() + " is not supported");
+                    }
                     return false;
                 }
             } else {



Mime
View raw message