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 private static Log LOGGER = LogFactory.getLog(FlowConstructStats.class);
36
37 public FlowConstructStats(FlowConstructStatistics statistics)
38 {
39 this.statistics = statistics;
40 }
41
42 public long getAverageProcessingTime()
43 {
44 return statistics.getAverageProcessingTime();
45 }
46
47 public long getProcessedEvents()
48 {
49 return statistics.getProcessedEvents();
50 }
51
52 public long getMaxProcessingTime()
53 {
54 return statistics.getMaxProcessingTime();
55 }
56
57 public long getMinProcessingTime()
58 {
59 return statistics.getMinProcessingTime();
60 }
61
62 public long getTotalProcessingTime()
63 {
64 return statistics.getTotalProcessingTime();
65 }
66
67 public void clearStatistics()
68 {
69 statistics.clear();
70 }
71
72 public long getAsyncEventsReceived()
73 {
74 return statistics.getAsyncEventsReceived();
75 }
76
77 public long getSyncEventsReceived()
78 {
79 return statistics.getSyncEventsReceived();
80 }
81
82 public long getTotalEventsReceived()
83 {
84 return statistics.getTotalEventsReceived();
85 }
86
87 public long getExecutionErrors()
88 {
89 return statistics.getExecutionErrors();
90 }
91
92 public long getFatalErrors()
93 {
94 return statistics.getFatalErrors();
95 }
96
97 public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
98 {
99 this.server = server;
100 this.name = name;
101 return name;
102 }
103
104 public void postRegister(Boolean registrationDone)
105 {
106
107 }
108
109 public void preDeregister() throws Exception
110 {
111
112 }
113
114 public void postDeregister()
115 {
116
117 }
118 }