private synchronized T findCounterImpl(String counterName, boolean create) { T counter = counters.get(counterName); if (counter == null && create) { String localized = ResourceBundles.getCounterName(getName(), counterName, counterName); return addCounterImpl(counterName, localized, 0); } return counter; }
private synchronized T findCounterImpl(String counterName, boolean create) { T counter = counters.get(counterName); if (counter == null && create) { String localized = ResourceBundles.getCounterName(getName(), counterName, counterName); return addCounterImpl(counterName, localized, 0); } return counter; }
private synchronized T findCounterImpl(String counterName, boolean create) { T counter = counters.get(counterName); if (counter == null && create) { String localized = ResourceBundles.getCounterName(getName(), counterName, counterName); return addCounterImpl(counterName, localized, 0); } return counter; }
private synchronized T findCounterImpl(String counterName, boolean create) { T counter = counters.get(counterName); if (counter == null && create) { String localized = ResourceBundles.getCounterName(getName(), counterName, counterName); return addCounterImpl(counterName, localized, 0); } return counter; }
@Override public synchronized T findCounter(String counterName, String displayName) { // Take lock to avoid two threads not finding a counter and trying to add // the same counter. String saveName = Limits.filterCounterName(counterName); T counter = findCounterImpl(saveName, false); if (counter == null) { return addCounterImpl(saveName, displayName, 0); } return counter; }
@Override public synchronized T findCounter(String counterName, String displayName) { // Take lock to avoid two threads not finding a counter and trying to add // the same counter. String saveName = Limits.filterCounterName(counterName); T counter = findCounterImpl(saveName, false); if (counter == null) { return addCounterImpl(saveName, displayName, 0); } return counter; }
@Override public synchronized T findCounter(String counterName, String displayName) { // Take lock to avoid two threads not finding a counter and trying to add // the same counter. String saveName = Limits.filterCounterName(counterName); T counter = findCounterImpl(saveName, false); if (counter == null) { return addCounterImpl(saveName, displayName, 0); } return counter; }
@Override public synchronized T findCounter(String counterName, String displayName) { // Take lock to avoid two threads not finding a counter and trying to add // the same counter. String saveName = Limits.filterCounterName(counterName); T counter = findCounterImpl(saveName, false); if (counter == null) { return addCounterImpl(saveName, displayName, 0); } return counter; }
@Override public synchronized T addCounter(String counterName, String displayName, long value) { String saveName = Limits.filterCounterName(counterName); T counter = findCounterImpl(saveName, false); if (counter == null) { return addCounterImpl(saveName, displayName, value); } counter.setValue(value); return counter; }
@Override public synchronized T addCounter(String counterName, String displayName, long value) { String saveName = Limits.filterCounterName(counterName); T counter = findCounterImpl(saveName, false); if (counter == null) { return addCounterImpl(saveName, displayName, value); } counter.setValue(value); return counter; }
@Override public synchronized T addCounter(String counterName, String displayName, long value) { String saveName = Limits.filterCounterName(counterName); T counter = findCounterImpl(saveName, false); if (counter == null) { return addCounterImpl(saveName, displayName, value); } counter.setValue(value); return counter; }
@Override public synchronized T addCounter(String counterName, String displayName, long value) { String saveName = Limits.filterCounterName(counterName); T counter = findCounterImpl(saveName, false); if (counter == null) { return addCounterImpl(saveName, displayName, value); } counter.setValue(value); return counter; }