1 10 11 package org.mule.util.counters; 12 13 import org.mule.util.counters.impl.CounterFactoryImpl; 14 15 import java.util.Iterator ; 16 17 29 public class CounterFactory 30 { 31 32 38 public static final class Type 39 { 40 41 42 public static final Type NUMBER = new Type("Number"); 43 44 public static final Type SUM = new Type("Sum"); 45 46 public static final Type MIN = new Type("Min"); 47 48 public static final Type MAX = new Type("Max"); 49 50 public static final Type AVERAGE = new Type("Average"); 51 52 public static final Type TIME_AVERAGE = new Type("TimeAverage"); 53 54 public static final Type DELTA = new Type("Delta"); 55 56 public static final Type INSTANT_RATE = new Type("InstantRate"); 57 58 public static final Type RATE_PER_SECOND = new Type("RatePerSecond"); 59 60 public static final Type RATE_PER_MINUTE = new Type("RatePerMinute"); 61 62 public static final Type RATE_PER_HOUR = new Type("RatePerHour"); 63 64 public static final Type PLUS = new Type("Plus"); 65 66 public static final Type MINUS = new Type("Minus"); 67 68 public static final Type MULTIPLY = new Type("Multiply"); 69 70 public static final Type DIVIDE = new Type("Divide"); 71 72 73 private String name; 74 75 80 protected Type(String name) 81 { 82 this.name = name; 83 } 84 85 public String getName() 86 { 87 return this.name; 88 } 89 } 90 91 97 public static Counter getCounter(String name) 98 { 99 return CounterFactoryImpl.getCounter(name); 100 } 101 102 109 public static Counter createCounter(String name, Type type) 110 { 111 return createCounter(name, null, null, type, true); 112 } 113 114 122 public static Counter createCounter(String name, Type type, boolean visible) 123 { 124 return createCounter(name, null, null, type, visible); 125 } 126 127 135 public static Counter createCounter(String name, String base, Type type) 136 { 137 return createCounter(name, base, null, type, true); 138 } 139 140 149 public static Counter createCounter(String name, String base, Type type, boolean visible) 150 { 151 return createCounter(name, base, null, type, visible); 152 } 153 154 163 public static Counter createCounter(String name, String first, String second, Type type) 164 { 165 return createCounter(name, first, second, type, true); 166 } 167 168 178 public static Counter createCounter(String name, String first, String second, Type type, boolean visible) 179 { 180 return CounterFactoryImpl.createCounter(name, first, second, type, visible); 181 } 182 183 188 public static Iterator getCounters() 189 { 190 return CounterFactoryImpl.getCounters(); 191 } 192 193 } 194 | Popular Tags |