Coverage Report - org.mule.service.processor.ServiceStatisticsMessageProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
ServiceStatisticsMessageProcessor
0%
0/8
0%
0/4
2
 
 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  
 public class ServiceStatisticsMessageProcessor implements MessageProcessor
 15  
 {
 16  
     protected Service service;
 17  
 
 18  
     public ServiceStatisticsMessageProcessor(Service service)
 19  0
     {
 20  0
         this.service = service;
 21  0
     }
 22  
 
 23  
     public MuleEvent process(MuleEvent event) throws MuleException
 24  
     {
 25  0
         if (service.getStatistics().isEnabled())
 26  
         {
 27  0
             if (event.getEndpoint().getExchangePattern().hasResponse())
 28  
             {
 29  0
                 service.getStatistics().incReceivedEventSync();
 30  
             }
 31  
             else
 32  
             {
 33  0
                 service.getStatistics().incReceivedEventASync();
 34  
             }
 35  
         }
 36  
 
 37  0
         return event;
 38  
     }
 39  
 }