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