Coverage Report - org.mule.service.processor.ServiceLoggingMessageProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
ServiceLoggingMessageProcessor
0%
0/10
0%
0/6
2.5
 
 1  
 /*
 2  
  * $Id: ServiceLoggingMessageProcessor.java 20320 2010-11-24 15:03:31Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.service.processor;
 12  
 
 13  
 import org.mule.api.MuleEvent;
 14  
 import org.mule.api.MuleException;
 15  
 import org.mule.api.processor.MessageProcessor;
 16  
 import org.mule.api.service.Service;
 17  
 
 18  
 import org.apache.commons.logging.Log;
 19  
 import org.apache.commons.logging.LogFactory;
 20  
 
 21  
 public class ServiceLoggingMessageProcessor implements MessageProcessor
 22  
 {
 23  0
     protected final transient Log logger = LogFactory.getLog(getClass());
 24  
     protected Service service;
 25  
 
 26  
     public ServiceLoggingMessageProcessor(Service service)
 27  0
     {
 28  0
         this.service = service;
 29  0
     }
 30  
 
 31  
     public MuleEvent process(MuleEvent event) throws MuleException
 32  
     {
 33  0
         if (event.getEndpoint().getExchangePattern().hasResponse())
 34  
         {
 35  0
             if (logger.isDebugEnabled())
 36  
             {
 37  0
                 logger.debug("Service: " + service.getName() + " has received synchronous event on: "
 38  
                              + event.getEndpoint().getEndpointURI());
 39  
             }
 40  
         }
 41  
         else
 42  
         {
 43  0
             if (logger.isDebugEnabled())
 44  
             {
 45  0
                 logger.debug("Service: " + service.getName() + " has received asynchronous event on: "
 46  
                              + event.getEndpoint().getEndpointURI());
 47  
             }
 48  
         }
 49  
 
 50  0
         return event;
 51  
     }
 52  
 }