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  
  * $Id: ProcessingTimeInterceptor.java 20370 2010-11-28 01:31:24Z mike.schilling $
 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.interceptor;
 12  
 
 13  
 import org.mule.api.MuleEvent;
 14  
 import org.mule.api.MuleException;
 15  
 import org.mule.api.construct.FlowConstruct;
 16  
 import org.mule.api.processor.MessageProcessor;
 17  
 import org.mule.management.stats.FlowConstructStatistics;
 18  
 import org.mule.management.stats.ProcessingTime;
 19  
 
 20  
 /**
 21  
  * Calculate and record the processing time for a message processing chain
 22  
  */
 23  
 public class ProcessingTimeInterceptor extends AbstractEnvelopeInterceptor
 24  
 {
 25  
     public ProcessingTimeInterceptor()
 26  0
     {
 27  0
     }
 28  
 
 29  
     public ProcessingTimeInterceptor(MessageProcessor next, FlowConstruct fc)
 30  0
     {
 31  0
         setListener(next);
 32  0
         setFlowConstruct(fc);
 33  0
     }
 34  
 
 35  
     @Override
 36  
     public MuleEvent before(MuleEvent event) throws MuleException
 37  
     {
 38  0
         return event;
 39  
     }
 40  
 
 41  
     @Override
 42  
     public MuleEvent after(MuleEvent event) throws MuleException
 43  
     {
 44  0
         return event;
 45  
     }
 46  
 
 47  
 
 48  
     @Override
 49  
     public MuleEvent last(MuleEvent event, ProcessingTime time, long startTime, boolean exceptionWasThrown) throws MuleException
 50  
     {
 51  0
         if (time != null)
 52  
         {
 53  0
             time.addFlowExecutionBranchTime(startTime);
 54  
         }
 55  0
         return event;
 56  
     }
 57  
 }