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