Java AtomicInteger resetExceptionCount()

Here you can find the source of resetExceptionCount()

Description

reset Exception Count

License

Apache License

Declaration

public static Map<String, Integer> resetExceptionCount() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;
import java.util.Map;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

public class Main {
    private static int singleMax = 0;
    private static AtomicInteger criticalCount = new AtomicInteger();
    private static String singleMaxName = "";
    private static Map<String/*exception or method*/, AtomicInteger> exceptionCount = new ConcurrentHashMap<String, AtomicInteger>();
    private static Long exceptionTimefrom = System.currentTimeMillis();

    public static Map<String, Integer> resetExceptionCount() {
        Map<String, AtomicInteger> cur = exceptionCount;
        exceptionCount = new ConcurrentHashMap<String, AtomicInteger>();
        criticalCount.set(0);//  w  w  w .  j  av a 2 s .com
        exceptionTimefrom = System.currentTimeMillis();
        singleMax = 0;
        singleMaxName = "";
        return getCountMap(cur);
    }

    private static Map<String, Integer> getCountMap(Map<String, AtomicInteger> countMap) {
        Map<String, Integer> result = new HashMap<String, Integer>();
        for (Map.Entry<String, AtomicInteger> entry : countMap.entrySet()) {
            result.put(entry.getKey(), entry.getValue().get());
        }
        return result;
    }
}

Related

  1. print2DIntArray(int[][] array)
  2. printResults(Stream> resultPartitionsStream)
  3. reset()
  4. resetCounter()
  5. resetCounters()
  6. setBit(AtomicInteger i, int mask)
  7. setBitByValue(final AtomicInteger ai, final int value)
  8. setBitIfUnsetByIndex(final AtomicInteger ai, final int n)
  9. storeStoreBarrier()