1
2
3
4
5
6
7
8
9
10
11 package org.mule.lifecycle;
12
13 import org.mule.api.MuleEvent;
14 import org.mule.api.MuleException;
15 import org.mule.api.component.Component;
16 import org.mule.api.construct.FlowConstruct;
17 import org.mule.api.construct.FlowConstructAware;
18 import org.mule.management.stats.ComponentStatistics;
19
20 import org.mockito.Mockito;
21
22
23
24
25 public class LifecycleTrackerComponent extends AbstractLifecycleTracker implements FlowConstructAware, Component
26 {
27
28 private FlowConstruct flowConstruct;
29
30 public void springInitialize()
31 {
32 getTracker().add("springInitialize");
33 }
34
35 public void springDestroy()
36 {
37 getTracker().add("springDestroy");
38 }
39
40 public void setFlowConstruct(final FlowConstruct flowConstruct)
41 {
42 getTracker().add("setService");
43 this.flowConstruct = flowConstruct;
44 }
45
46 public FlowConstruct getFlowConstruct()
47 {
48 return flowConstruct;
49 }
50
51 public ComponentStatistics getStatistics()
52 {
53 return Mockito.mock(ComponentStatistics.class);
54 }
55
56 public MuleEvent process(MuleEvent event) throws MuleException
57 {
58 return event;
59 }
60 }