1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
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 | |
|
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 | |
} |