Java AtomicInteger loadServiceCount(String id)

Here you can find the source of loadServiceCount(String id)

Description

load Service Count

License

Apache License

Declaration

private synchronized static int loadServiceCount(String id) 

Method Source Code

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

import java.util.Map;

import java.util.concurrent.ConcurrentHashMap;

import java.util.concurrent.atomic.AtomicInteger;

public class Main {
    private static Map<String, AtomicInteger> m_service_load_count_map = new ConcurrentHashMap<String, AtomicInteger>();

    private synchronized static int loadServiceCount(String id) {
        AtomicInteger count = m_service_load_count_map.get(id);
        if (count == null) {
            count = new AtomicInteger(1);
            m_service_load_count_map.put(id, count);
            return 1;
        } else {/* w ww . j  a  v a2 s. c o m*/
            return count.incrementAndGet();
        }
    }
}

Related

  1. getTimeBasedUUID()
  2. getUniqueId()
  3. getUuidAsFourCharacterGroups()
  4. increase(A a, Map map)
  5. isPropBlocked(String s)
  6. print2DIntArray(int[][] array)
  7. printResults(Stream> resultPartitionsStream)
  8. reset()
  9. resetCounter()