1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.module.management.mbean; |
11 | |
|
12 | |
import org.apache.commons.logging.Log; |
13 | |
import org.apache.commons.logging.LogFactory; |
14 | |
import org.mule.management.stats.FlowConstructStatistics; |
15 | |
|
16 | |
import javax.management.MBeanRegistration; |
17 | |
import javax.management.MBeanServer; |
18 | |
import javax.management.ObjectName; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
public class FlowConstructStats implements FlowConstructStatsMBean, MBeanRegistration |
24 | |
{ |
25 | |
private final FlowConstructStatistics statistics; |
26 | |
|
27 | |
|
28 | |
protected MBeanServer server; |
29 | |
|
30 | |
protected ObjectName name; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | 0 | private static Log LOGGER = LogFactory.getLog(FlowConstructStats.class); |
36 | |
|
37 | |
public FlowConstructStats(FlowConstructStatistics statistics) |
38 | 0 | { |
39 | 0 | this.statistics = statistics; |
40 | 0 | } |
41 | |
|
42 | |
public long getAverageProcessingTime() |
43 | |
{ |
44 | 0 | return statistics.getAverageProcessingTime(); |
45 | |
} |
46 | |
|
47 | |
public long getProcessedEvents() |
48 | |
{ |
49 | 0 | return statistics.getProcessedEvents(); |
50 | |
} |
51 | |
|
52 | |
public long getMaxProcessingTime() |
53 | |
{ |
54 | 0 | return statistics.getMaxProcessingTime(); |
55 | |
} |
56 | |
|
57 | |
public long getMinProcessingTime() |
58 | |
{ |
59 | 0 | return statistics.getMinProcessingTime(); |
60 | |
} |
61 | |
|
62 | |
public long getTotalProcessingTime() |
63 | |
{ |
64 | 0 | return statistics.getTotalProcessingTime(); |
65 | |
} |
66 | |
|
67 | |
public void clearStatistics() |
68 | |
{ |
69 | 0 | statistics.clear(); |
70 | 0 | } |
71 | |
|
72 | |
public long getAsyncEventsReceived() |
73 | |
{ |
74 | 0 | return statistics.getAsyncEventsReceived(); |
75 | |
} |
76 | |
|
77 | |
public long getSyncEventsReceived() |
78 | |
{ |
79 | 0 | return statistics.getSyncEventsReceived(); |
80 | |
} |
81 | |
|
82 | |
public long getTotalEventsReceived() |
83 | |
{ |
84 | 0 | return statistics.getTotalEventsReceived(); |
85 | |
} |
86 | |
|
87 | |
public long getExecutionErrors() |
88 | |
{ |
89 | 0 | return statistics.getExecutionErrors(); |
90 | |
} |
91 | |
|
92 | |
public long getFatalErrors() |
93 | |
{ |
94 | 0 | return statistics.getFatalErrors(); |
95 | |
} |
96 | |
|
97 | |
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception |
98 | |
{ |
99 | 0 | this.server = server; |
100 | 0 | this.name = name; |
101 | 0 | return name; |
102 | |
} |
103 | |
|
104 | |
public void postRegister(Boolean registrationDone) |
105 | |
{ |
106 | |
|
107 | 0 | } |
108 | |
|
109 | |
public void preDeregister() throws Exception |
110 | |
{ |
111 | |
|
112 | 0 | } |
113 | |
|
114 | |
public void postDeregister() |
115 | |
{ |
116 | |
|
117 | 0 | } |
118 | |
} |