Coverage Report - org.mule.interceptor.ProcessingTimeInterceptor
 
Classes in this File Line Coverage Branch Coverage Complexity
ProcessingTimeInterceptor
0%
0/11
0%
0/2
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.interceptor;
 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.processor.MessageProcessor;
 13  
 import org.mule.management.stats.ProcessingTime;
 14  
 
 15  
 /**
 16  
  * Calculate and record the processing time for a message processing chain
 17  
  */
 18  
 public class ProcessingTimeInterceptor extends AbstractEnvelopeInterceptor
 19  
 {
 20  
     public ProcessingTimeInterceptor()
 21  
     {
 22  0
         super();
 23  0
     }
 24  
 
 25  
     public ProcessingTimeInterceptor(MessageProcessor next, FlowConstruct fc)
 26  0
     {
 27  0
         setListener(next);
 28  0
         setFlowConstruct(fc);
 29  0
     }
 30  
 
 31  
     @Override
 32  
     public MuleEvent before(MuleEvent event) throws MuleException
 33  
     {
 34  0
         return event;
 35  
     }
 36  
 
 37  
     @Override
 38  
     public MuleEvent after(MuleEvent event) throws MuleException
 39  
     {
 40  0
         return event;
 41  
     }
 42  
 
 43  
 
 44  
     @Override
 45  
     public MuleEvent last(MuleEvent event, ProcessingTime time, long startTime, boolean exceptionWasThrown) throws MuleException
 46  
     {
 47  0
         if (time != null)
 48  
         {
 49  0
             time.addFlowExecutionBranchTime(startTime);
 50  
         }
 51  0
         return event;
 52  
     }
 53  
 }