1
2
3
4
5
6
7
8 package it.imolinfo.jbi4corba.jbi.component;
9
10 import javax.management.MBeanException;
11 import javax.management.openmbean.TabularData;
12 import javax.management.openmbean.OpenDataException;
13
14 import net.java.hulp.measure.Group;
15
16 import com.sun.jbi.eManager.provider.PerformanceMeasurement;
17
18
19
20
21
22 public class Jbi4CorbaPerformanceMeasurement implements PerformanceMeasurement {
23
24 public static final String JBI4CORBA_BC_SOURCE_FILTER = "it.imolinfo.jbi4corba.*";
25
26
27
28
29
30
31
32
33 public TabularData getPerformanceInstrumentationMeasurement(String endpoint) throws OpenDataException, MBeanException {
34 Group gr = Group.createGroup();
35 gr.addPattern(JBI4CORBA_BC_SOURCE_FILTER, endpoint, getPerfCatFilter());
36 return gr.fetchData();
37 }
38
39
40
41
42
43
44 public void clearPeformaceInstrumentationMeasurement (String endpoint) throws MBeanException {
45 Group gr = Group.createGroup();
46 gr.addPattern(JBI4CORBA_BC_SOURCE_FILTER, endpoint, getPerfCatFilter());
47 gr.clearData();
48 }
49
50 private String getPerfCatFilter() {
51 StringBuffer perfCatFilter = new StringBuffer();
52 for (int i=0; i < Jbi4CorbaLifeCycle.JBI4CORBABC_PERF_CATEGORIES.length; i++) {
53 perfCatFilter.append(Jbi4CorbaLifeCycle.JBI4CORBABC_PERF_CATEGORIES[i]);
54 if (i < Jbi4CorbaLifeCycle.JBI4CORBABC_PERF_CATEGORIES.length-1) {
55 perfCatFilter.append('|');
56 }
57 }
58 return perfCatFilter.toString();
59 }
60 }