Coverage Report - org.mule.construct.processor.FlowConstructStatisticsMessageProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
FlowConstructStatisticsMessageProcessor
0%
0/9
0%
0/4
0
 
 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.construct.processor;
 8  
 
 9  
 import org.mule.api.MuleEvent;
 10  
 import org.mule.api.MuleException;
 11  
 import org.mule.api.construct.FlowConstruct;
 12  
 import org.mule.api.construct.FlowConstructAware;
 13  
 import org.mule.api.processor.MessageProcessor;
 14  
 import org.mule.util.ObjectUtils;
 15  
 
 16  0
 public class FlowConstructStatisticsMessageProcessor implements MessageProcessor, FlowConstructAware
 17  
 {
 18  
     protected FlowConstruct flowConstruct;
 19  
 
 20  
     public MuleEvent process(MuleEvent event) throws MuleException
 21  
     {
 22  0
         if (flowConstruct.getStatistics().isEnabled())
 23  
         {
 24  0
             if (event.getEndpoint().getExchangePattern().hasResponse())
 25  
             {
 26  0
                 flowConstruct.getStatistics().incReceivedEventSync();
 27  
             }
 28  
             else
 29  
             {
 30  0
                 flowConstruct.getStatistics().incReceivedEventASync();
 31  
             }
 32  
         }
 33  
 
 34  0
         return event;
 35  
     }
 36  
 
 37  
     public void setFlowConstruct(FlowConstruct flowConstruct)
 38  
     {
 39  0
         this.flowConstruct = flowConstruct;
 40  0
     }
 41  
 
 42  
     @Override
 43  
     public String toString()
 44  
     {
 45  0
         return ObjectUtils.toString(this);
 46  
     }
 47  
 }