Example usage for java.util.concurrent ConcurrentHashMap ConcurrentHashMap

List of usage examples for java.util.concurrent ConcurrentHashMap ConcurrentHashMap

Introduction

In this page you can find the example usage for java.util.concurrent ConcurrentHashMap ConcurrentHashMap.

Prototype

public ConcurrentHashMap() 

Source Link

Document

Creates a new, empty map with the default initial table size (16).

Usage

From source file:org.hellojavaer.poi.excel.utils.write.ExcelWriteFieldMapping.java

public ExcelWriteFieldMappingAttribute put(String colIndex, String fieldName) {
    Assert.notNull(colIndex);//  www.j  av  a 2  s. c o  m
    Assert.notNull(fieldName);
    Map<Integer, ExcelWriteFieldMappingAttribute> map = fieldMapping.get(fieldName);
    if (map == null) {
        synchronized (fieldMapping) {
            if (fieldMapping.get(colIndex) == null) {
                map = new ConcurrentHashMap<Integer, ExcelWriteFieldMappingAttribute>();
                fieldMapping.put(fieldName, map);
            }
        }
    }
    ExcelWriteFieldMappingAttribute attribute = new ExcelWriteFieldMappingAttribute();
    map.put(ExcelUtils.convertColCharIndexToIntIndex(colIndex), attribute);
    return attribute;
}

From source file:org.craftercms.engine.service.context.SiteContextManager.java

public SiteContextManager() {
    lock = new ReentrantLock();
    contextRegistry = new ConcurrentHashMap<>();
}

From source file:org.openmrs.module.privilegehelper.PrivilegeLogger.java

public PrivilegeLogger() {
    logByUserId = new ConcurrentHashMap<Integer, PrivilegeLog>();
}

From source file:org.ado.biblio.BarCodeCache.java

@PostConstruct
private void init() {
    map = new ConcurrentHashMap<String, List<BookMessage>>();
}

From source file:org.ow2.proactive.connector.iaas.cloud.provider.azure.AzureServiceCache.java

public AzureServiceCache() {
    serviceCache = new ConcurrentHashMap<>();
}

From source file:ConcurrentHashSet.java

/**
 * Constructs a new, empty set; the backing <tt>ConcurrentHashMap</tt> instance has default
 * initial capacity (16) and load factor (0.75).
 */// w  w w.  j  ava2 s .c om
public ConcurrentHashSet() {
    map = new ConcurrentHashMap<E, Object>();
}

From source file:com.guang.eunormia.common.cache.DefaultLocalCache.java

@SuppressWarnings("unchecked")
private void init() {
    caches = new ConcurrentHashMap[moduleSize];

    for (int i = 0; i < moduleSize; i++) {
        caches[i] = new ConcurrentHashMap<K, SoftReference<V>>();
    }//  w  w w.j a  v a  2  s. com

    expiryCache = new ConcurrentHashMap<K, Long>();

    scheduleService = Executors.newScheduledThreadPool(1);

    scheduleService.scheduleAtFixedRate(new CheckOutOfDateSchedule(caches, expiryCache), 0, expiryInterval * 60,
            TimeUnit.SECONDS);

    if (Logger.isInfoEnabled()) {
        Logger.info("DefaultCache CheckService is start!");
    }
}

From source file:com.ejisto.modules.executor.TaskManager.java

public TaskManager() {
    this.registry = new ConcurrentHashMap<>();
    this.executorService = Executors.newCachedThreadPool();
    this.scheduler = Executors.newScheduledThreadPool(5);
    this.scheduler.scheduleAtFixedRate(this::refreshTasksList, 500L, 500L, MILLISECONDS);
}

From source file:com.espertech.esper.core.service.StatementIsolationServiceImpl.java

/**
 * Ctor.
 */
public StatementIsolationServiceImpl() {
    isolatedProviders = new ConcurrentHashMap<String, EPServiceProviderIsolatedImpl>();
}

From source file:com.ejisto.event.ApplicationEventDispatcher.java

public ApplicationEventDispatcher(TaskManager taskManager) {
    this.registeredListeners = new ConcurrentHashMap<>();
    this.taskManager = taskManager;
    this.running = true;
    Thread t = new Thread(() -> {
        try {/*  w  w  w  . j av a2  s .  c  om*/
            processPendingEvents();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new IllegalStateException(e);
        }
    }, "applicationEventDispatcher");
    t.setDaemon(true);
    t.start();
}