servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1149721 - in /servicemix/smx3/trunk: core/servicemix-core/src/main/java/org/apache/servicemix/components/util/ core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/ core/servicemix-core/src/main/java/org/apache/servicemix/tck/...
Date Fri, 22 Jul 2011 20:18:51 GMT
Author: jbonofre
Date: Fri Jul 22 20:18:43 2011
New Revision: 1149721

URL: http://svn.apache.org/viewvc?rev=1149721&view=rev
Log:
[SM-2048] Use slf4j as default logging system in place of commons-logging.

Modified:
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/EchoComponent.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PollingComponentSupport.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/SpringBootstrap.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TraceComponent.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TransformComponentSupport.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewEndpointListener.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/EndpointViewRenderer.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/AsyncReceiverPojo.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/MessageList.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SenderPojo.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SpringTestSupport.java
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/TestSupport.java
    servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/main/java/org/apache/servicemix/lwcontainer/LwContainerBootstrap.java
    servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/test/java/org/apache/servicemix/lwcontainer/LwContainerComponentTest.java
    servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java
    servicemix/smx3/trunk/distributions/apache-servicemix-web/src/test/java/org/apache/servicemix/web/http/HttpManagedServletTest.java
    servicemix/smx3/trunk/platforms/geronimo/deployer-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixConfigBuilder.java
    servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/Component.java
    servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceAssembly.java
    servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixGBean.java
    servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/SharedLibrary.java
    servicemix/smx3/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/deadlock/TraceComponent.java
    servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIComponentsPortlet.java
    servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIContainerPortlet.java
    servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/ServiceMixPortlet.java
    servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/jmx/EnhancedMBeanProxyFactoryBean.java

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/EchoComponent.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/EchoComponent.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/EchoComponent.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/EchoComponent.java Fri Jul 22 20:18:43 2011
@@ -21,9 +21,9 @@ import javax.jbi.messaging.MessagingExce
 import javax.jbi.messaging.NormalizedMessage;
 import javax.xml.namespace.QName;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.MessageExchangeListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A simple, yet useful component for testing synchronous flows. Echos back Exchanges
@@ -32,7 +32,7 @@ import org.apache.servicemix.MessageExch
  */
 public class EchoComponent extends TransformComponentSupport implements MessageExchangeListener {
     
-    private static final Log LOG = LogFactory.getLog(EchoComponent.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(EchoComponent.class);
     
     public EchoComponent() {
     }
@@ -43,7 +43,8 @@ public class EchoComponent extends Trans
     
     protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws MessagingException {
         getMessageTransformer().transform(exchange, in, out);
-        LOG.info("Echoed back message: " + out);
+        LOGGER.info("Echoed back message: {}", out);
         return true;
     }
+
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/OutBinding.java Fri Jul 22 20:18:43 2011
@@ -25,9 +25,9 @@ import javax.jbi.messaging.MessageExchan
 import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.MessageExchangeListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A base class for bindings which process inbound JBI messages
@@ -36,7 +36,7 @@ import org.apache.servicemix.MessageExch
  */
 public abstract class OutBinding extends ComponentSupport implements Runnable, MessageExchangeListener {
 
-    private static final Log LOG = LogFactory.getLog(OutBinding.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(OutBinding.class);
 
     private AtomicBoolean stop = new AtomicBoolean(true);
     private Thread runnable;
@@ -50,9 +50,7 @@ public abstract class OutBinding extends
                 NormalizedMessage message = getInMessage(exchange);
                 process(exchange, message);
             } catch (Exception e) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Exchange failed", e);
-                }
+                LOGGER.debug("Exchange failed", e);
                 fail(exchange, e);
             }
         }
@@ -70,7 +68,7 @@ public abstract class OutBinding extends
                     try {
                         onMessageExchange(exchange);
                     } catch (MessagingException e) {
-                        LOG.error("MessageExchange processing failed", e);
+                        LOGGER.error("MessageExchange processing failed", e);
                     }
                 }
             }
@@ -79,7 +77,7 @@ public abstract class OutBinding extends
             // i.e. the exception has not been thrown to interrupt
             // this thread
             if (!stop.get()) {
-                LOG.error("run failed", e);
+                LOGGER.error("run failed", e);
             }
         }
     }
@@ -104,7 +102,7 @@ public abstract class OutBinding extends
             try {
                 runnable.join();
             } catch (InterruptedException e) {
-                LOG.warn("Unable to stop component polling thread", e);
+                LOGGER.warn("Unable to stop component polling thread", e);
             }
             runnable = null;
         }
@@ -132,4 +130,5 @@ public abstract class OutBinding extends
      * @throws Exception if an error occurs
      */
     protected abstract void process(MessageExchange messageExchange, NormalizedMessage message) throws Exception;
+
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java Fri Jul 22 20:18:43 2011
@@ -33,8 +33,6 @@ import javax.jbi.servicedesc.ServiceEndp
 import javax.management.ObjectName;
 import javax.xml.namespace.QName;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.FaultException;
 import org.apache.servicemix.jbi.NotInitialisedYetException;
 import org.apache.servicemix.jbi.management.BaseLifeCycle;
@@ -46,8 +44,6 @@ import org.apache.servicemix.jbi.managem
  */
 public abstract class PojoSupport extends BaseLifeCycle implements ComponentLifeCycle {
 
-    protected Log logger = LogFactory.getLog(getClass());
-    
     private ComponentContext context;
     private ObjectName extensionMBeanName;
     private QName service;

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PollingComponentSupport.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PollingComponentSupport.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PollingComponentSupport.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/PollingComponentSupport.java Fri Jul 22 20:18:43 2011
@@ -21,14 +21,14 @@ import java.util.Date;
 import javax.jbi.JBIException;
 import javax.resource.spi.work.Work;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.components.varscheduler.ScheduleIterator;
 import org.apache.servicemix.components.varscheduler.Scheduler;
 import org.apache.servicemix.components.varscheduler.SchedulerTask;
 import org.apache.servicemix.executors.Executor;
 import org.apache.servicemix.executors.ExecutorFactory;
 import org.apache.servicemix.jbi.framework.ComponentContextImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * An implementation inheritence class for a component which polls some resource
@@ -38,7 +38,7 @@ import org.apache.servicemix.jbi.framewo
  */
 public abstract class PollingComponentSupport extends ComponentSupport implements Work {
     
-    private static final Log LOG = LogFactory.getLog(PollingComponentSupport.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(PollingComponentSupport.class);
 
     private Executor executor;
     private Scheduler scheduler;
@@ -64,7 +64,7 @@ public abstract class PollingComponentSu
         try {
             poll();
         } catch (Exception e) {
-            LOG.error("Caught exception while polling: " + e, e);
+            LOGGER.error("Caught exception while polling: {}", e.getMessage(), e);
         }
     }
 
@@ -165,7 +165,7 @@ public abstract class PollingComponentSu
                 // the threads are setup correctly when we actually do stuff
                 getExecutor().execute(PollingComponentSupport.this);
             } catch (Throwable e) {
-                LOG.error("Failed to schedule work: " + e, e);
+                LOGGER.error("Failed to schedule work: {}", e.getMessage(), e);
             }
         }
     }
@@ -185,4 +185,5 @@ public abstract class PollingComponentSu
             return started ? new Date(nextTime) : null;
         }
     }
+
 }
\ No newline at end of file

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/SpringBootstrap.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/SpringBootstrap.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/SpringBootstrap.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/SpringBootstrap.java Fri Jul 22 20:18:43 2011
@@ -26,10 +26,12 @@ import javax.management.ObjectName;
 
 import org.w3c.dom.DocumentFragment;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.NotInitialisedYetException;
 import org.apache.servicemix.jbi.container.ActivationSpec;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
@@ -41,7 +43,7 @@ import org.springframework.context.Appli
  */
 public class SpringBootstrap implements Bootstrap, ApplicationContextAware {
 
-    private static final Log LOG = LogFactory.getLog(SpringBootstrap.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(SpringBootstrap.class);
 
     private InstallationContext installContext;
 
@@ -66,15 +68,15 @@ public class SpringBootstrap implements 
         }
         DocumentFragment fragment = installContext.getInstallationDescriptorExtension();
         if (fragment != null) {
-            LOG.debug("Installation Descriptor Extension Found");
+            LOGGER.debug("Installation Descriptor Extension Found");
         } else {
-            LOG.debug("Installation Descriptor Extension Not Found !");
+            LOGGER.debug("Installation Descriptor Extension Not Found !");
         }
         // lets load this from Spring...
         Map map = applicationContext.getBeansOfType(ActivationSpec.class, false, false);
         for (Iterator iter = map.values().iterator(); iter.hasNext();) {
             ActivationSpec spec = (ActivationSpec) iter.next();
-            LOG.debug("Registering " + spec.getComponentName());
+            LOGGER.debug("Registering {}", spec.getComponentName());
         }
     }
 
@@ -88,4 +90,5 @@ public class SpringBootstrap implements 
     public void setApplicationContext(ApplicationContext appCtx) throws BeansException {
         this.applicationContext = appCtx;
     }
+
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TraceComponent.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TraceComponent.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TraceComponent.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TraceComponent.java Fri Jul 22 20:18:43 2011
@@ -22,10 +22,10 @@ import javax.jbi.messaging.NormalizedMes
 import javax.xml.transform.Source;
 import javax.xml.transform.TransformerException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.MessageExchangeListener;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A simple tracing component which can be placed inside a pipeline
@@ -35,16 +35,12 @@ import org.apache.servicemix.jbi.jaxp.So
  */
 public class TraceComponent extends ComponentSupport implements MessageExchangeListener {
 
-    private Log log = LogFactory.getLog(TraceComponent.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(TraceComponent.class);
 
     private SourceTransformer sourceTransformer = new SourceTransformer();
 
-    public Log getLog() {
-        return log;
-    }
-
-    public void setLog(Log log) {
-        this.log = log;
+    public Logger getLog() {
+        return LOGGER;
     }
 
     public SourceTransformer getSourceTransformer() {
@@ -65,13 +61,13 @@ public class TraceComponent extends Comp
         // lets dump the incoming message  
         NormalizedMessage message = exchange.getMessage("in");
         if (message == null) {
-            log.warn("Received null message from exchange: " + exchange);
+            LOGGER.warn("Received null message from exchange: {}", exchange);
         } else {
-            log.info("Exchange: " + exchange + " received IN message: " + message);
+            LOGGER.info("Exchange: {} received IN message: {}", exchange, message);
             try {
-                log.info("Body is: " + sourceTransformer.toString(message.getContent()));
+                LOGGER.info("Body is: {}", sourceTransformer.toString(message.getContent()));
             } catch (TransformerException e) {
-                log.error("Failed to turn message body into text: " + e, e);
+                LOGGER.error("Failed to turn message body into text: {}", e.getMessage(), e);
             }
             outputProperties(message);
         }
@@ -103,10 +99,11 @@ public class TraceComponent extends Comp
                     contents = getSourceTransformer().toString((Source) contents);
                 }
 
-                log.info("Value for property '" + key + "' is: " + contents);
+                LOGGER.info("Value for property '{}' is: {}", key, contents);
             } catch (TransformerException e) {
-                log.error("Failed to turn property '" + key + "' value into text: " + e, e);
+                LOGGER.error("Failed to turn property '{}' value into text", key, e);
             }
         }
     }
+
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TransformComponentSupport.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TransformComponentSupport.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TransformComponentSupport.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/TransformComponentSupport.java Fri Jul 22 20:18:43 2011
@@ -33,6 +33,8 @@ import org.apache.servicemix.jbi.util.Me
 import org.apache.servicemix.store.Store;
 import org.apache.servicemix.store.StoreFactory;
 import org.apache.servicemix.store.memory.MemoryStoreFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A useful base class for a transform component.
@@ -40,6 +42,8 @@ import org.apache.servicemix.store.memor
  * @version $Revision$
  */
 public abstract class TransformComponentSupport extends ComponentSupport implements MessageExchangeListener {
+
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(TransformComponentSupport.class);
     
     private String correlation;
     
@@ -131,10 +135,8 @@ public abstract class TransformComponent
             try {
                 fail(exchange, e);
             } catch (Exception e2) {
-                logger.warn("Unable to handle error: " + e2, e2);
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Original error: " + e, e);
-                }
+                LOGGER.warn("Unable to handle error: {}", e2.getMessage(), e2);
+                LOGGER.debug("Original error: {}", e.getMessage(), e);
             }
         }
     }
@@ -180,9 +182,7 @@ public abstract class TransformComponent
                         + " but has no Out nor Fault message");
             }
         } catch (Exception e) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Original error: " + e, e);
-            }
+            LOGGER.debug("Original error: {}", e.getMessage(), e);
         }
     }
     

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewEndpointListener.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewEndpointListener.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewEndpointListener.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewEndpointListener.java Fri Jul 22 20:18:43 2011
@@ -22,13 +22,13 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.event.ContainerAware;
 import org.apache.servicemix.jbi.framework.ComponentMBeanImpl;
 import org.apache.servicemix.jbi.framework.Endpoint;
 import org.apache.servicemix.jbi.framework.Registry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Creates a <a href="http://www.graphviz.org/">DOT</a> file showing the various components
@@ -41,7 +41,7 @@ import org.apache.servicemix.jbi.framewo
  */
 public class DotViewEndpointListener extends EndpointViewRenderer implements ContainerAware {
 
-    private static final Log LOG = LogFactory.getLog(DotViewEndpointListener.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(DotViewEndpointListener.class);
 
     private JBIContainer container;
     private String file = "ServiceMixComponents.dot";
@@ -67,9 +67,7 @@ public class DotViewEndpointListener ext
     // -------------------------------------------------------------------------
 
     protected void doRender() throws Exception {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Creating DOT file at: " + file);
-        }
+        LOGGER.debug("Creating DOT file at: {}", file);
         PrintWriter writer = new PrintWriter(new FileWriter(file));
         try {
             generateFile(writer);
@@ -189,5 +187,4 @@ public class DotViewEndpointListener ext
         return buffer.toString();
     }
 
-
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/EndpointViewRenderer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/EndpointViewRenderer.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/EndpointViewRenderer.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/EndpointViewRenderer.java Fri Jul 22 20:18:43 2011
@@ -18,10 +18,10 @@ package org.apache.servicemix.jbi.view;
 
 import javax.jbi.servicedesc.ServiceEndpoint;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.event.EndpointEvent;
 import org.apache.servicemix.jbi.event.EndpointListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A base class for renderings of endpoints which can re-render whenever something
@@ -31,7 +31,7 @@ import org.apache.servicemix.jbi.event.E
  */
 public abstract class EndpointViewRenderer implements EndpointListener {
 
-    private static final Log LOG = LogFactory.getLog(EndpointViewRenderer.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(EndpointViewRenderer.class);
     
     private boolean dirty;
     private boolean rerenderOnChange = true;
@@ -97,7 +97,7 @@ public abstract class EndpointViewRender
             try {
                 render();
             } catch (Exception e) {
-                LOG.warn("Failed to render view: " + e, e);
+                LOGGER.warn("Failed to render view: {}", e.getMessage(), e);
             }
         }
     }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/AsyncReceiverPojo.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/AsyncReceiverPojo.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/AsyncReceiverPojo.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/AsyncReceiverPojo.java Fri Jul 22 20:18:43 2011
@@ -27,8 +27,8 @@ import javax.jbi.messaging.NormalizedMes
 import javax.management.ObjectName;
 import javax.xml.namespace.QName;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A simple POJO which just implements the {@link javax.jbi.component.ComponentLifeCycle}
@@ -41,7 +41,7 @@ public class AsyncReceiverPojo implement
     public static final QName SERVICE = ReceiverPojo.SERVICE;
     public static final String ENDPOINT = ReceiverPojo.ENDPOINT;
 
-    private static final Log LOG = LogFactory.getLog(AsyncReceiverPojo.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(AsyncReceiverPojo.class);
 
     private ComponentContext context;
     private MessageList messageList = new MessageList();
@@ -88,12 +88,12 @@ public class AsyncReceiverPojo implement
         while (running) {
             try {
                 DeliveryChannel deliveryChannel = context.getDeliveryChannel();
-                LOG.info("about to do an accept on deliveryChannel: " + deliveryChannel);
+                LOGGER.info("about to do an accept on deliveryChannel: {}", deliveryChannel);
                 MessageExchange messageExchange = deliveryChannel.accept();
-                LOG.info("received me: " + messageExchange);
+                LOGGER.info("received me: {}", messageExchange);
                 onMessageExchange(messageExchange);
             } catch (MessagingException e) {
-                LOG.error("Failed to process inbound messages: " + e, e);
+                LOGGER.error("Failed to process inbound messages: {}", e.getMessage(), e);
             }
         }
     }
@@ -108,4 +108,5 @@ public class AsyncReceiverPojo implement
     public ComponentContext getContext() {
         return context;
     }
+
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/MessageList.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/MessageList.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/MessageList.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/MessageList.java Fri Jul 22 20:18:43 2011
@@ -25,10 +25,10 @@ import javax.jbi.messaging.NormalizedMes
 
 import junit.framework.Assert;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.client.Message;
 import org.apache.servicemix.client.MessageListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A simple container for performing testing and rendezvous style code.
@@ -37,7 +37,7 @@ import org.apache.servicemix.client.Mess
  */
 public class MessageList extends Assert implements MessageListener {
 
-    private static final Log LOG = LogFactory.getLog(MessageList.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(MessageList.class);
 
     private List messages = new ArrayList();
 
@@ -93,7 +93,7 @@ public class MessageList extends Assert 
     }
 
     public void waitForMessagesToArrive(int messageCount, long baseTimeout) {
-        LOG.info("Waiting for message to arrive");
+        LOGGER.info("Waiting for message to arrive");
 
         long start = System.currentTimeMillis();
 
@@ -106,12 +106,12 @@ public class MessageList extends Assert 
                     semaphore.wait(4000);
                 }
             } catch (InterruptedException e) {
-                LOG.info("Caught: " + e);
+                LOGGER.info("Caught: {}", e);
             }
         }
         long end = System.currentTimeMillis() - start;
 
-        LOG.info("End of wait for " + end + " millis");
+        LOGGER.info("End of wait for {} millis", end);
     }
 
     /**
@@ -139,4 +139,5 @@ public class MessageList extends Assert 
     public void onMessage(MessageExchange exchange, Message message) throws Exception {
         addMessage(message);
     }
+
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SenderPojo.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SenderPojo.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SenderPojo.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SenderPojo.java Fri Jul 22 20:18:43 2011
@@ -29,10 +29,10 @@ import javax.jbi.messaging.NormalizedMes
 import javax.jbi.servicedesc.ServiceEndpoint;
 import javax.xml.namespace.QName;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.components.util.PojoSupport;
 import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Revision$
@@ -43,7 +43,7 @@ public class SenderPojo extends PojoSupp
 
     public static final String ENDPOINT = "sender";
 
-    private static final Log LOG = LogFactory.getLog(SenderPojo.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(SenderPojo.class);
 
     protected QName interfaceName;
     protected int numMessages = 10;
@@ -77,12 +77,12 @@ public class SenderPojo extends PojoSupp
     }
 
     public void sendMessages(int messageCount, boolean sync) throws MessagingException {
-        LOG.info("Looking for services for interface: " + interfaceName);
+        LOGGER.info("Looking for services for interface: {}", interfaceName);
 
         ServiceEndpoint[] endpoints = context.getEndpointsForService(interfaceName);
         if (endpoints.length > 0) {
             ServiceEndpoint endpoint = endpoints[0];
-            LOG.info("Sending to endpoint: " + endpoint);
+            LOGGER.info("Sending to endpoint: {}", endpoint);
 
             for (int i = 0; i < messageCount; i++) {
                 InOnly exchange = context.getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
@@ -94,9 +94,9 @@ public class SenderPojo extends PojoSupp
                            + "  <s12:Body><foo>Hello!</foo> </s12:Body>"
                            + "</s12:Envelope>";
                 message.setContent(new StringSource(xml));
-                LOG.info("sending message: " + i);
+                LOGGER.info("sending message: {}", i);
                 DeliveryChannel deliveryChannel = context.getDeliveryChannel();
-                LOG.info("sync send on deliverychannel: " + deliveryChannel);
+                LOGGER.info("sync send on deliverychannel: {}", deliveryChannel);
                 if (sync) {
                     deliveryChannel.sendSync(exchange);
                 } else {
@@ -104,7 +104,7 @@ public class SenderPojo extends PojoSupp
                 }
             }
         } else {
-            LOG.warn("No endpoints available for interface: " + interfaceName);
+            LOGGER.warn("No endpoints available for interface: {}", interfaceName);
         }
     }
 
@@ -125,4 +125,5 @@ public class SenderPojo extends PojoSupp
     public void setNumMessages(int numMessages) {
         this.numMessages = numMessages;
     }
+
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SpringTestSupport.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SpringTestSupport.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SpringTestSupport.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/SpringTestSupport.java Fri Jul 22 20:18:43 2011
@@ -38,19 +38,22 @@ import org.xml.sax.SAXException;
 
 import junit.framework.TestCase;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.container.SpringJBIContainer;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.jbi.util.DOMUtil;
 import org.apache.xpath.CachedXPathAPI;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.springframework.context.support.AbstractXmlApplicationContext;
 
 /**
  * @version $Revision$
  */
 public abstract class SpringTestSupport extends TestCase {
-    protected transient Log log = LogFactory.getLog(getClass());
+
+    protected static final transient Logger LOGGER = LoggerFactory.getLogger(SpringTestSupport.class);
 
     protected AbstractXmlApplicationContext context;
 
@@ -76,7 +79,7 @@ public abstract class SpringTestSupport 
 
     protected void tearDown() throws Exception {
         if (context != null) {
-            log.info("Closing down the spring context");
+            LOGGER.info("Closing down the spring context");
             context.destroy();
         }
     }
@@ -134,8 +137,8 @@ public abstract class SpringTestSupport 
         int counter = 0;
         for (Iterator iter = list.iterator(); iter.hasNext();) {
             NormalizedMessage message = (NormalizedMessage) iter.next();
-            log.info("Message " + (counter++) + " is: " + message);
-            log.info(transformer.contentToString(message));
+            LOGGER.info("Message {} is: {}", counter++, message);
+            LOGGER.info(transformer.contentToString(message));
         }
     }
 
@@ -150,4 +153,5 @@ public abstract class SpringTestSupport 
             fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
         }
     }
+
 }

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/TestSupport.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/TestSupport.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/TestSupport.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/tck/TestSupport.java Fri Jul 22 20:18:43 2011
@@ -198,8 +198,8 @@ public abstract class TestSupport extend
         String value = textValueOfXPath(node, xpath);
         String xmlText = transformer.toString(node);
 
-        if (log.isTraceEnabled()) {
-            log.trace("Message: " + index + " received XML: " + xmlText);
+        if (LOGGER.isTraceEnabled()) {
+            LOGGER.trace("Message: " + index + " received XML: " + xmlText);
         }
 
         assertEquals("message XML: " + index + " for xpath: " + xpath + " body was: " + xmlText, expectedValue, value);

Modified: servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/main/java/org/apache/servicemix/lwcontainer/LwContainerBootstrap.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/main/java/org/apache/servicemix/lwcontainer/LwContainerBootstrap.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/main/java/org/apache/servicemix/lwcontainer/LwContainerBootstrap.java (original)
+++ servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/main/java/org/apache/servicemix/lwcontainer/LwContainerBootstrap.java Fri Jul 22 20:18:43 2011
@@ -22,19 +22,18 @@ import javax.jbi.component.InstallationC
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Base class for components bootstrap.
- * 
- * @author Guillaume Nodet
+ *
  * @version $Revision$
  * @since 3.0
  */
 public class LwContainerBootstrap implements Bootstrap {
 
-    protected final transient Log logger = LogFactory.getLog(getClass());
+    protected static final transient Logger LOGGER = LoggerFactory.getLogger(LwContainerBootstrap.class);
     
     protected InstallationContext context;
     protected ObjectName mbeanName;
@@ -59,14 +58,10 @@ public class LwContainerBootstrap implem
      */
     public void init(InstallationContext installContext) throws JBIException {
         try {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Initializing bootstrap");
-            }
+            LOGGER.debug("Initializing bootstrap");
             this.context = installContext;
             doInit();
-            if (logger.isDebugEnabled()) {
-                logger.debug("Bootstrap initialized");
-            }
+            LOGGER.debug("Bootstrap initialized");
         } catch (JBIException e) {
             throw e;
         } catch (Exception e) {
@@ -94,13 +89,9 @@ public class LwContainerBootstrap implem
      */
     public void cleanUp() throws JBIException {
         try {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Cleaning up bootstrap");
-            }
+            LOGGER.debug("Cleaning up bootstrap");
             doCleanUp();
-            if (logger.isDebugEnabled()) {
-                logger.debug("Bootstrap cleaned up");
-            }
+            LOGGER.debug("Bootstrap cleaned up");
         } catch (JBIException e) {
             throw e;
         } catch (Exception e) {
@@ -125,13 +116,9 @@ public class LwContainerBootstrap implem
      */
     public void onInstall() throws JBIException {
         try {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Bootstrap onInstall");
-            }
+            LOGGER.debug("Bootstrap onInstall");
             doOnInstall();
-            if (logger.isDebugEnabled()) {
-                logger.debug("Bootstrap onInstall done");
-            }
+            LOGGER.debug("Bootstrap onInstall done");
         } catch (JBIException e) {
             throw e;
         } catch (Exception e) {
@@ -147,13 +134,9 @@ public class LwContainerBootstrap implem
      */
     public void onUninstall() throws JBIException {
         try {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Bootstrap onUninstall");
-            }
+            LOGGER.debug("Bootstrap onUninstall");
             doOnUninstall();
-            if (logger.isDebugEnabled()) {
-                logger.debug("Bootstrap onUninstall done");
-            }
+            LOGGER.debug("Bootstrap onUninstall done");
         } catch (JBIException e) {
             throw e;
         } catch (Exception e) {

Modified: servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/test/java/org/apache/servicemix/lwcontainer/LwContainerComponentTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/test/java/org/apache/servicemix/lwcontainer/LwContainerComponentTest.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/test/java/org/apache/servicemix/lwcontainer/LwContainerComponentTest.java (original)
+++ servicemix/smx3/trunk/deployables/serviceengines/servicemix-lwcontainer/src/test/java/org/apache/servicemix/lwcontainer/LwContainerComponentTest.java Fri Jul 22 20:18:43 2011
@@ -25,20 +25,20 @@ import javax.jbi.messaging.MessagingExce
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.client.DefaultServiceMixClient;
 import org.apache.servicemix.client.ServiceMixClient;
 import org.apache.servicemix.jbi.container.InstallComponent;
 import org.apache.servicemix.jbi.container.InstallSharedLibrary;
 import org.apache.servicemix.jbi.container.JBIContainer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
- * 
  * @version $Revision$
  */
 public class LwContainerComponentTest extends TestCase {
-    private static transient Log log = LogFactory.getLog(LwContainerComponentTest.class);
+
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(LwContainerComponentTest.class);
 
     protected JBIContainer container = new JBIContainer();
 
@@ -57,7 +57,7 @@ public class LwContainerComponentTest ex
         if (!tempTemp.mkdirs()) {
             fail("Unable to create temporary working root directory [" + tempTemp.getAbsolutePath() + "]");
         }
-        log.info("Using temporary root directory [" + tempRootDir.getAbsolutePath() + "]");
+        LOGGER.info("Using temporary root directory [{}]", tempRootDir.getAbsolutePath());
 
         container.setRootDir(tempRootDir.getAbsolutePath());
         container.setMonitorInstallationDirectory(false);
@@ -151,7 +151,7 @@ public class LwContainerComponentTest ex
     }
 
     public static boolean deleteDir(File dir) {
-        log.info("Deleting directory : " + dir.getAbsolutePath());
+        LOGGER.info("Deleting directory: {}", dir.getAbsolutePath());
         if (dir.isDirectory()) {
             String[] children = dir.list();
             for (int i = 0; i < children.length; i++) {
@@ -164,4 +164,5 @@ public class LwContainerComponentTest ex
         // The directory is now empty so delete it
         return dir.delete();
     }
+
 }

Modified: servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java (original)
+++ servicemix/smx3/trunk/distributions/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java Fri Jul 22 20:18:43 2011
@@ -20,23 +20,21 @@ import java.lang.reflect.Method;
 
 import javax.jbi.component.Component;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.event.ComponentEvent;
 import org.apache.servicemix.jbi.event.ComponentListener;
 import org.apache.servicemix.jbi.event.ContainerAware;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This ComponentListener is a hack to automatically configure
  * the servicemix-http component in managed mode while avoiding
  * to embed the component itself.
- * 
- * @author gnodet
  */
 public class HttpComponentListener implements ComponentListener, ContainerAware {
 
-    private static final Log log = LogFactory.getLog(HttpComponentListener.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(HttpComponentListener.class);
     
     private String name = "servicemix-http";
     private JBIContainer container;
@@ -87,9 +85,9 @@ public class HttpComponentListener imple
                     m = cfg.getClass().getMethod("setManaged", new Class[] { boolean.class });
                     m.invoke(cfg, new Object[] { Boolean.TRUE });
                 }
-                log.info("Component " + getName() + " configured.");
+                LOGGER.info("Component {} configured", getName());
             } catch (Exception e) {
-                log.error("Unable to update component configuration", e);
+                LOGGER.error("Unable to update component configuration", e);
             }
         }
     }

Modified: servicemix/smx3/trunk/distributions/apache-servicemix-web/src/test/java/org/apache/servicemix/web/http/HttpManagedServletTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/distributions/apache-servicemix-web/src/test/java/org/apache/servicemix/web/http/HttpManagedServletTest.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/distributions/apache-servicemix-web/src/test/java/org/apache/servicemix/web/http/HttpManagedServletTest.java (original)
+++ servicemix/smx3/trunk/distributions/apache-servicemix-web/src/test/java/org/apache/servicemix/web/http/HttpManagedServletTest.java Fri Jul 22 20:18:43 2011
@@ -25,8 +25,6 @@ import junit.framework.TestCase;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.methods.StringRequestEntity;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.xbean.spring.context.XmlWebApplicationContext;
 import org.mortbay.jetty.Connector;
 import org.mortbay.jetty.Handler;
@@ -38,10 +36,13 @@ import org.mortbay.jetty.nio.SelectChann
 import org.mortbay.jetty.servlet.ServletHandler;
 import org.mortbay.jetty.servlet.ServletHolder;
 import org.mortbay.jetty.servlet.ServletMapping;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.web.context.ContextLoaderListener;
 
 public class HttpManagedServletTest extends TestCase {
-    private static Log logger = LogFactory.getLog(HttpManagedServletTest.class);
+
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(HttpManagedServletTest.class);
 
     private Server server;
 
@@ -84,7 +85,7 @@ public class HttpManagedServletTest exte
         server.setHandler(handlers);
         server.start();
 
-        logger.info("Started");
+        LOGGER.info("Started");
 
         PostMethod post = new PostMethod("http://localhost:8190/test/jbi/Service/");
         post.setRequestEntity(new StringRequestEntity(
@@ -92,6 +93,7 @@ public class HttpManagedServletTest exte
                                         + "<soap:Body><hello>world</hello></soap:Body>" + "</soap:Envelope>"));
         new HttpClient().executeMethod(post);
         assertEquals(200, post.getStatusCode());
-        logger.info(post.getResponseBodyAsString());
+        LOGGER.info(post.getResponseBodyAsString());
     }
+
 }

Modified: servicemix/smx3/trunk/platforms/geronimo/deployer-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixConfigBuilder.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/platforms/geronimo/deployer-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixConfigBuilder.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/platforms/geronimo/deployer-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixConfigBuilder.java (original)
+++ servicemix/smx3/trunk/platforms/geronimo/deployer-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixConfigBuilder.java Fri Jul 22 20:18:43 2011
@@ -34,8 +34,6 @@ import javax.jbi.component.Component;
 import javax.jbi.component.ServiceUnitManager;
 import javax.management.MalformedObjectNameException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.ConfigurationBuilder;
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -66,10 +64,12 @@ import org.apache.servicemix.jbi.deploym
 import org.apache.servicemix.jbi.deployment.ServiceUnit;
 import org.apache.servicemix.jbi.deployment.SharedLibraryList;
 import org.apache.xmlbeans.XmlObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ServiceMixConfigBuilder implements ConfigurationBuilder {
 
-    private static final Log log = LogFactory.getLog(ServiceMixConfigBuilder.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(ServiceMixConfigBuilder.class);
 
     private final Environment defaultEnvironment;
 
@@ -118,7 +118,7 @@ public class ServiceMixConfigBuilder imp
      */
     public Object getDeploymentPlan(File planFile, JarFile module, ModuleIDBuilder idBuilder)
                     throws DeploymentException {
-        log.debug("Checking for ServiceMix deployment.");
+        LOGGER.debug("Checking for ServiceMix deployment.");
         if (module == null) {
             return null;
         }
@@ -140,7 +140,7 @@ public class ServiceMixConfigBuilder imp
 					object = XmlObject.Factory.parse(planFile);
 				}
 			} catch (Exception e) {
-				log.info("error " + e);
+				LOGGER.info("Error", e);
 			}
 			
 			if (object != null) {
@@ -159,7 +159,7 @@ public class ServiceMixConfigBuilder imp
 						
             return new DeploymentPlanWrapper(descriptor, geronimoPlan);
         } catch (Exception e) {
-            log.debug("Not a ServiceMix deployment: no jbi.xml found.", e);
+            LOGGER.debug("Not a ServiceMix deployment: no jbi.xml found.", e);
             // no jbi.xml, not for us
             return null;
         }
@@ -203,7 +203,7 @@ public class ServiceMixConfigBuilder imp
      * @param inPlaceDeployment
      * @param configId
      * @param plan
-     * @param earFile
+     * @param jarFile
      * @param configurationStores
      * @param artifactResolver
      * @param targetConfigurationStore
@@ -217,15 +217,15 @@ public class ServiceMixConfigBuilder imp
                     JarFile jarFile, Collection configurationStores, ArtifactResolver artifactResolver,
                     ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
         if (plan == null) {
-            log.warn("Expected a Descriptor but received null");
+            LOGGER.warn("Expected a Descriptor but received null");
             return null;
         }
         if (plan instanceof DeploymentPlanWrapper == false) {
-            log.warn("Expected a Descriptor but received a " + plan.getClass().getName());
+            LOGGER.warn("Expected a Descriptor but received a {}", plan.getClass().getName());
             return null;
         }
         if (((DeploymentPlanWrapper)plan).getServicemixDescriptor() == null) {
-            log.warn("Expected a SM Descriptor but received null");
+            LOGGER.warn("Expected a SM Descriptor but received null");
             return null;
         }
         File configurationDir;
@@ -245,11 +245,11 @@ public class ServiceMixConfigBuilder imp
         	if (wrapper.getGeronimoPlan().getJbi() != null) {
         		EnvironmentType environmentType = wrapper.getGeronimoPlan().getJbi().getEnvironment();
         		if (environmentType != null) {
-        			log.debug("Environment found in Geronimo Plan for Servicemix " + environmentType);
+        			LOGGER.debug("Environment found in Geronimo Plan for ServiceMix {}", environmentType);
         			Environment geronimoPlanEnvironment = EnvironmentBuilder.buildEnvironment(environmentType);
         			EnvironmentBuilder.mergeEnvironments(environment, geronimoPlanEnvironment);
         		} else {
-        			log.debug("no additional environment entry found in deployment plan for JBI component");
+        			LOGGER.debug("no additional environment entry found in deployment plan for JBI component");
         		}
         	}
         }
@@ -360,7 +360,7 @@ public class ServiceMixConfigBuilder imp
              File installDir = new File(context.getBaseDir(), installUri.toString());
              String deploy = serviceUnitManager.deploy(name, installDir.getAbsolutePath());  
              serviceUnitReferences.add(new ServiceUnitReference(sl, name, installDir.getAbsolutePath()));
-             log.debug(deploy);
+             LOGGER.debug(deploy);
         }
         // Create the JBI deployment managed object
         Properties props = new Properties();
@@ -431,7 +431,7 @@ public class ServiceMixConfigBuilder imp
             String[] pathElements = descriptor.getSharedLibrary().getSharedLibraryClassPath().getPathElements();
             if (pathElements != null) {
                 for (int i = 0; i < pathElements.length; i++) {
-                    log.debug("Processing pathElements[" + i + "]: " + pathElements[i]);
+                    LOGGER.debug("Processing pathElements[{}]: {}", i, pathElements[i]);
                     // We can not add includes directly, so move the file and
                     // include it
                     File include = new File(targetDir, pathElements[i]);
@@ -445,10 +445,10 @@ public class ServiceMixConfigBuilder imp
                     temp.delete();
                 }
             } else {
-                log.debug("SharedLibrary().getSharedLibraryClassPath().getPathElements() is null");
+                LOGGER.debug("SharedLibrary().getSharedLibraryClassPath().getPathElements() is null");
             }
         } else {
-            log.debug("SharedLibrary().getSharedLibraryClassPath() is null");
+            LOGGER.debug("SharedLibrary().getSharedLibraryClassPath() is null");
         }
         // Create the JBI deployment managed object
         Properties props = new Properties();

Modified: servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/Component.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/Component.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/Component.java (original)
+++ servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/Component.java Fri Jul 22 20:18:43 2011
@@ -19,15 +19,15 @@ package org.apache.servicemix.geronimo;
 import java.net.URI;
 import java.net.URL;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class Component implements GBeanLifecycle {
 
-    private static final Log log = LogFactory.getLog(Component.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(Component.class);
 
     private String name;
 
@@ -65,28 +65,28 @@ public class Component implements GBeanL
         this.installDir = rootDir.resolve("install/");
         this.workDir = rootDir.resolve("workspace/");
         this.classLoader = classLoader;
-        log.debug("Created JBI component: " + name);
+        LOGGER.debug("Created JBI component: {}", name);
     }
 
     public void doStart() throws Exception {
-        log.debug("doStart called for JBI component: " + name);
+        LOGGER.debug("doStart called for JBI component: {}", name);
         try {
             component = (javax.jbi.component.Component) classLoader.loadClass(className).newInstance();
             container.register(this);
         } catch (ClassNotFoundException e) {
-            log.error(classLoader);
+            LOGGER.error(classLoader.toString());
         }
-        log.info("Started servicemix JBI component: " + name);
+        LOGGER.info("Started servicemix JBI component: {}", name);
     }
 
     public void doStop() throws Exception {
-        log.debug("doStop called for JBI component: " + name);
+        LOGGER.debug("doStop called for JBI component: {}", name);
         container.unregister(this);
         component = null;
     }
 
     public void doFail() {
-        log.debug("doFail called for JBI component: " + name);
+        LOGGER.debug("doFail called for JBI component: {}", name);
         component = null;
     }
 

Modified: servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceAssembly.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceAssembly.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceAssembly.java (original)
+++ servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceAssembly.java Fri Jul 22 20:18:43 2011
@@ -24,8 +24,6 @@ import java.util.Properties;
 
 import javax.jbi.component.ServiceUnitManager;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -35,10 +33,12 @@ import org.apache.geronimo.kernel.Kernel
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.servicemix.jbi.deployment.Descriptor;
 import org.apache.servicemix.jbi.deployment.DescriptorFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ServiceAssembly implements GBeanLifecycle {
 
-    private static final Log log = LogFactory.getLog(ServiceAssembly.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(ServiceAssembly.class);
     
     private String name;
     private Container container;
@@ -61,21 +61,21 @@ public class ServiceAssembly implements 
         } else {
             this.rootDir = URI.create(configurationBaseUrl.toString());
         }
-        log.info("Created JBI service assembly: " + name);
+        LOGGER.info("Created JBI service assembly: {}", name);
 	}
 	
     public void doStart() throws Exception {
-        log.info("doStart called for JBI service assembly: " + name);
+        LOGGER.info("doStart called for JBI service assembly: {}", name);
         container.register(this);
     }
 
     public void doStop() throws Exception {
-        log.info("doStop called for JBI service assembly: " + name);
+        LOGGER.info("doStop called for JBI service assembly: {}", name);
         container.unregister(this);
     }
 
     public void doFail() {
-        log.info("doFail called for JBI service assembly: " + name);
+        LOGGER.info("doFail called for JBI service assembly: {}", name);
     }
 	
     public URI getRootDir() {

Modified: servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixGBean.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixGBean.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixGBean.java (original)
+++ servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/ServiceMixGBean.java Fri Jul 22 20:18:43 2011
@@ -23,8 +23,6 @@ import java.util.Set;
 import javax.jbi.JBIException;
 import javax.transaction.TransactionManager;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -41,10 +39,12 @@ import org.apache.servicemix.jbi.framewo
 import org.apache.servicemix.jbi.framework.ComponentNameSpace;
 import org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle;
 import org.apache.servicemix.jbi.nmr.flow.Flow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ServiceMixGBean implements GBeanLifecycle, Container {
 
-    private Log log = LogFactory.getLog(getClass().getName());
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(ServiceMixGBean.class);
     
     private JBIContainer container;
     private boolean persistent = false;
@@ -83,9 +83,7 @@ public class ServiceMixGBean implements 
         this.transactionManagerName = transactionManagerName;
         this.flows = flows;
         this.kernel = kernel;
-        if (log.isDebugEnabled()) {
-            log.debug("ServiceMixGBean created");
-        }
+        LOGGER.debug("ServiceMixGBean created");
     }
     
     /**
@@ -103,9 +101,7 @@ public class ServiceMixGBean implements 
      * @throws Exception if the target failed to start; this will cause a transition to the failed state
      */
     public void doStart() throws Exception {        
-        if (log.isDebugEnabled()) {
-            log.debug("ServiceMixGBean doStart");
-        }
+        LOGGER.debug("ServiceMixGBean doStart");
         ClassLoader old = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(ServiceMixGBean.class.getClassLoader());
         try {
@@ -127,9 +123,7 @@ public class ServiceMixGBean implements 
      * @throws Exception if the target failed to stop; this will cause a transition to the failed state
      */
     public void doStop() throws Exception {
-        if (log.isDebugEnabled()) {
-            log.debug("ServiceMixGBean doStop");
-        }
+        LOGGER.debug("ServiceMixGBean doStop");
         try {
             if (container != null) {
                 container.shutDown();
@@ -143,16 +137,14 @@ public class ServiceMixGBean implements 
      * Fails the GBean.  This informs the GBean that it is about to transition to the failed state.
      */
     public void doFail() {
-        if (log.isDebugEnabled()) {
-            log.debug("ServiceMixGBean doFail");
-        }
+        LOGGER.debug("ServiceMixGBean doFail");
         try {
             if (container != null) {
                 try {
                     container.shutDown();
                 }
                 catch (JBIException e) {
-                    log.info("Caught while closing due to failure: " + e, e);
+                    LOGGER.info("Caught while closing due to failure: {}", e.getMessage(), e);
                 }
             }
         } finally {

Modified: servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/SharedLibrary.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/SharedLibrary.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/SharedLibrary.java (original)
+++ servicemix/smx3/trunk/platforms/geronimo/servicemix-service/src/main/java/org/apache/servicemix/geronimo/SharedLibrary.java Fri Jul 22 20:18:43 2011
@@ -16,15 +16,15 @@
  */
 package org.apache.servicemix.geronimo;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SharedLibrary implements GBeanLifecycle {
 
-    private static final Log log = LogFactory.getLog(SharedLibrary.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(SharedLibrary.class);
     
     private String name;
     private String description;
@@ -41,15 +41,15 @@ public class SharedLibrary implements GB
     }
 
     public void doStart() throws Exception {
-        log.info("doStart called for JBI service assembly: " + name);
+        LOGGER.info("doStart called for JBI service assembly: {}", name);
     }
 
     public void doStop() throws Exception {
-        log.info("doStop called for JBI service assembly: " + name);
+        LOGGER.info("doStop called for JBI service assembly: {}", name);
     }
 
     public void doFail() {
-        log.info("doFail called for JBI service assembly: " + name);
+        LOGGER.info("doFail called for JBI service assembly: {}", name);
     }
     
     public static final GBeanInfo GBEAN_INFO;

Modified: servicemix/smx3/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/deadlock/TraceComponent.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/deadlock/TraceComponent.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/deadlock/TraceComponent.java (original)
+++ servicemix/smx3/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/deadlock/TraceComponent.java Fri Jul 22 20:18:43 2011
@@ -21,21 +21,22 @@ import javax.jbi.messaging.MessagingExce
 import javax.jbi.messaging.NormalizedMessage;
 import javax.xml.transform.dom.DOMSource;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.tck.ReceiverComponent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Node;
 
 /**
  * A simple tracing component which can be placed inside a pipeline
  * to trace the message exchange though the component.
  *
- * @version $Revision: 426415 $
+ * @version $Revision$
  */
 public class TraceComponent extends ReceiverComponent {
 
-    private Log log = LogFactory.getLog(TraceComponent.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(TraceComponent.class);
+
     private int msToSleep=0;
     
     private SourceTransformer sourceTransformer = new SourceTransformer();
@@ -48,12 +49,8 @@ public class TraceComponent extends Rece
 		this.msToSleep = msToSleep;
 	}
 
-	public Log getLog() {
-        return log;
-    }
-
-    public void setLog(Log log) {
-        this.log = log;
+	public Logger getLog() {
+        return LOGGER;
     }
 
     public SourceTransformer getSourceTransformer() {
@@ -68,16 +65,16 @@ public class TraceComponent extends Rece
         // lets dump the incoming message
         NormalizedMessage message = exchange.getMessage("in");
         if (message == null) {
-            log.warn("Received null message from exchange: " + exchange);
+            LOGGER.warn("Received null message from exchange: {}", exchange);
         }
         else {
             try {
                 Node node = sourceTransformer.toDOMNode(message.getContent());
                 String str = sourceTransformer.toString(new DOMSource(node));
-                log.info("Body is: " + str);
+                LOGGER.info("Body is: {}", str);
             }
             catch (Exception e) {
-                log.error("Failed to turn message body into text: " + e, e);
+                LOGGER.error("Failed to turn message body into text: {}", e.getMessage(), e);
             }
         }
         
@@ -93,10 +90,8 @@ public class TraceComponent extends Rece
 	        }
 		}
 		catch (InterruptedException ie){
-			log.warn("Thread was interrupted.");
+			LOGGER.warn("Thread was interrupted.");
 		}
 	}
-    
-    
-    
+
 }

Modified: servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIComponentsPortlet.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIComponentsPortlet.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIComponentsPortlet.java (original)
+++ servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIComponentsPortlet.java Fri Jul 22 20:18:43 2011
@@ -119,7 +119,7 @@ public class JBIComponentsPortlet extend
 	        try {
 	            return (String) getServerConnection().getAttribute(name, attribute);
 	        } catch (Exception e) {
-	            log.error("Could not retrieve attribute '" + attribute + "' for mbean '" + name + "'");
+	            LOGGER.error("Could not retrieve attribute '" + attribute + "' for mbean '" + name + "'");
 	            return null;
 	        }
 	    }

Modified: servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIContainerPortlet.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIContainerPortlet.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIContainerPortlet.java (original)
+++ servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/JBIContainerPortlet.java Fri Jul 22 20:18:43 2011
@@ -76,7 +76,7 @@ public class JBIContainerPortlet extends
         try {
             return (String) getServerConnection().getAttribute(name, attribute);
         } catch (Exception e) {
-            log.error("Could not retrieve attribute '" + attribute + "' for mbean '" + name + "'");
+            LOGGER.error("Could not retrieve attribute '" + attribute + "' for mbean '" + name + "'");
             return null;
         }
     }

Modified: servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/ServiceMixPortlet.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/ServiceMixPortlet.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/ServiceMixPortlet.java (original)
+++ servicemix/smx3/trunk/web/servicemix-console/src/main/java/org/apache/servicemix/console/ServiceMixPortlet.java Fri Jul 22 20:18:43 2011
@@ -16,8 +16,6 @@
  */
 package org.apache.servicemix.console;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.audit.AuditorMBean;
 import org.apache.servicemix.jbi.audit.jdbc.JdbcAuditor;
 import org.apache.servicemix.jbi.container.JBIContainer;
@@ -25,6 +23,8 @@ import org.apache.servicemix.jbi.framewo
 import org.apache.servicemix.jbi.framework.InstallationService;
 import org.apache.servicemix.jbi.management.ManagementContext;
 import org.apache.servicemix.jbi.management.ManagementContextMBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jbi.management.DeploymentServiceMBean;
 import javax.jbi.management.InstallationServiceMBean;
@@ -54,7 +54,7 @@ import java.util.Map;
 
 public abstract class ServiceMixPortlet extends GenericPortlet {
 
-    protected final Log log = LogFactory.getLog(getClass());
+    protected static final transient Logger LOGGER = LoggerFactory.getLogger(ServiceMixPortlet.class);
     
     protected PortletRequestDispatcher normalView;
     protected PortletRequestDispatcher helpView;
@@ -85,7 +85,7 @@ public abstract class ServiceMixPortlet 
                 url = new JMXServiceURL(jmxUrl);
             }
             catch (MalformedURLException e) {
-                log.error("error creating serviceURL: ", e);
+                LOGGER.error("error creating serviceURL: ", e);
             }
         }
         return url;
@@ -98,7 +98,7 @@ public abstract class ServiceMixPortlet 
      * @throws IOException
      */
     public JMXConnector getJMXConnector (JMXServiceURL url) throws IOException {
-        log.info("Connecting to JBI Container at: " + url);
+        LOGGER.info("Connecting to JBI Container at: {}", url);
         String[] credentials = new String[] { username, password };
         Map environment = new HashMap();
         environment.put(JMXConnector.CREDENTIALS, credentials);
@@ -106,12 +106,12 @@ public abstract class ServiceMixPortlet 
     }
     
     protected void doHelp(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException {
-        log.debug("doHelp");
+        LOGGER.debug("doHelp");
         helpView.include(renderRequest, renderResponse);
     }
 
     protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException {
-        log.debug("doView");
+        LOGGER.debug("doView");
         if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
             return;
         }
@@ -122,16 +122,16 @@ public abstract class ServiceMixPortlet 
             }
             renderView(renderRequest, renderResponse);
         } catch (PortletException e) {
-            log.error("Error rendering portlet", e);
+            LOGGER.error("Error rendering portlet", e);
             closeConnector();
             throw e;
         } catch (IOException e) {
-            log.error("Error rendering portlet", e);
+            LOGGER.error("Error rendering portlet", e);
             closeConnector();
             throw e;
         } catch (Exception e) {
             try {
-                log.debug("Error rendering portlet", e);
+                LOGGER.debug("Error rendering portlet", e);
                 renderRequest.setAttribute("exception", e);
                 errorView.include(renderRequest, renderResponse);
             } finally {
@@ -163,7 +163,7 @@ public abstract class ServiceMixPortlet 
     }
 
     public void init(PortletConfig portletConfig) throws PortletException {
-        log.debug("init");
+        LOGGER.debug("init");
         super.init(portletConfig);
         PortletContext pc = portletConfig.getPortletContext();
         normalView = pc.getRequestDispatcher("/WEB-INF/view/" + getPortletName() + "/view.jsp");
@@ -188,7 +188,7 @@ public abstract class ServiceMixPortlet 
     }
 
     public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException {
-        log.debug("processAction: " + actionRequest);
+        LOGGER.debug("processAction: {}", actionRequest);
         try {
             // Retrieve the jmx connector
             if (this.jmxConnector == null) {
@@ -197,15 +197,15 @@ public abstract class ServiceMixPortlet 
             // Fill request
             doProcessAction(actionRequest, actionResponse);
         } catch (PortletException e) {
-            log.error("Error processing action", e);
+            LOGGER.error("Error processing action", e);
             closeConnector();
             throw e;
         } catch (IOException e) {
-            log.error("Error processing action", e);
+            LOGGER.error("Error processing action", e);
             closeConnector();
             throw e;
         } catch (Exception e) {
-            log.error("Error processing action", e);
+            LOGGER.error("Error processing action", e);
             closeConnector();
             throw new PortletException("Error processing action", e);
         }
@@ -224,7 +224,7 @@ public abstract class ServiceMixPortlet 
             try {
                 jmxConnector.close();
             } catch (Exception e) {
-                log.warn("caught an error closing the jmxConnector", e);
+                LOGGER.warn("caught an error closing the jmxConnector", e);
             } finally {
                 jmxConnector = null;
             }

Modified: servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/jmx/EnhancedMBeanProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/jmx/EnhancedMBeanProxyFactoryBean.java?rev=1149721&r1=1149720&r2=1149721&view=diff
==============================================================================
--- servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/jmx/EnhancedMBeanProxyFactoryBean.java (original)
+++ servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/jmx/EnhancedMBeanProxyFactoryBean.java Fri Jul 22 20:18:43 2011
@@ -16,8 +16,8 @@
  */
 package org.apache.servicemix.web.jmx;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.jmx.MBeanServerNotFoundException;
 import org.springframework.jmx.access.MBeanInfoRetrievalException;
 import org.springframework.jmx.access.MBeanProxyFactoryBean;
@@ -33,7 +33,8 @@ import java.io.IOException;
  */
 public class EnhancedMBeanProxyFactoryBean extends MBeanProxyFactoryBean {
 
-    private static final Log LOG = LogFactory.getLog(EnhancedMBeanProxyFactoryBean.class);
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(EnhancedMBeanProxyFactoryBean.class);
+
     protected static final String WEBSPHERE = "WebSphere";
 	
 	private MBeanServerConnection connection;
@@ -46,9 +47,7 @@ public class EnhancedMBeanProxyFactoryBe
 				doWebSphereConfiguration();
 			}
 		} catch (IOException e) {
-			if (LOG.isDebugEnabled()) {
-                LOG.debug("Unable to determine default domain name - assuming it's not WebSphere", e);
-            }
+			LOGGER.debug("Unable to determine default domain name - assuming it's not WebSphere", e);
 		}
 		super.afterPropertiesSet();
 	}
@@ -58,7 +57,7 @@ public class EnhancedMBeanProxyFactoryBe
      * JMX MBean object name.
      */
 	private void doWebSphereConfiguration() {
-		LOG.info("Running on WebSphere - adding cell/node/process information to " + originalName);
+		LOGGER.info("Running on WebSphere - adding cell/node/process information to {}", originalName);
 
 		try {
             String cell = null;
@@ -74,9 +73,7 @@ public class EnhancedMBeanProxyFactoryBe
 
             String name = String.format("%s,cell=%s,node=%s,process=%s", originalName, cell, node, process);
             super.setObjectName(name);
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Object name has been changed to " + name);
-            }
+            LOGGER.debug("Object name has been changed to {}", name);
 		} catch (MalformedObjectNameException e) {
             throw new MBeanInfoRetrievalException("Unable to determine cell/node/process information while running in WebSphere", e);
 		} catch (IOException e) {
@@ -97,4 +94,5 @@ public class EnhancedMBeanProxyFactoryBe
         this.originalName = name != null ? name.toString() : null;
         super.setObjectName(name);
     }
+
 }



Mime
View raw message