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