01: package org.objectweb.celtix.bus.management.counters;
02:
03: public class TransportClientCounters {
04: private static final String[] COUNTER_NAMES = { "Invoke",
05: "InvokeOneWay", "InvokeAsync", "InvokeError" };
06: private Counter[] counters;
07:
08: private String owner;
09:
10: public TransportClientCounters(String o) {
11: owner = o;
12: counters = new Counter[COUNTER_NAMES.length];
13: initCounters();
14: }
15:
16: public String getOwner() {
17: return owner;
18: }
19:
20: public Counter getInvoke() {
21: return counters[0];
22: }
23:
24: public Counter getInvokeOneWay() {
25: return counters[1];
26: }
27:
28: public Counter getInvokeAsync() {
29: return counters[2];
30:
31: }
32:
33: public Counter getInvokeError() {
34: return counters[3];
35: }
36:
37: private void initCounters() {
38: for (int i = 0; i < COUNTER_NAMES.length; i++) {
39: Counter c = new Counter(COUNTER_NAMES[i]);
40: counters[i] = c;
41: }
42: }
43:
44: public void resetCounters() {
45: for (int i = 0; i < counters.length; i++) {
46: counters[i].reset();
47: }
48: }
49:
50: public void stopCounters() {
51: for (int i = 0; i < counters.length; i++) {
52: counters[i].stop();
53: }
54: }
55:
56: }
|