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