Example usage for java.util Collections synchronizedMap

List of usage examples for java.util Collections synchronizedMap

Introduction

In this page you can find the example usage for java.util Collections synchronizedMap.

Prototype

public static <K, V> Map<K, V> synchronizedMap(Map<K, V> m) 

Source Link

Document

Returns a synchronized (thread-safe) map backed by the specified map.

Usage

From source file:org.dataconservancy.dcs.ingest.services.util.CachedSipStager.java

@PostConstruct
@SuppressWarnings("unchecked")
public void init() {
    cache = Collections.synchronizedMap(new CacheWriterMap(maxSize));
}

From source file:com.xerox.amazonws.simpledb.ItemVO.java

public ItemVO(String identifier) {
    this.identifier = identifier;
    attributes = Collections.synchronizedMap(new HashMap<String, Set<String>>());
}

From source file:iddb.core.cache.CacheFactory.java

private CacheFactory() {
    this.cacheMap = Collections.synchronizedMap(new HashMap<String, Cache>());
}

From source file:org.apache.hadoop.hive.service.HSSessionManager.java

protected HSSessionManager() {
    goOn = true;
    items = Collections.synchronizedMap(new TreeMap<HSSessionItem, HSAuth>());
    globalNewJarPath = "";
}

From source file:dev.maisentito.suca.commands.SeenCommandHandler.java

public SeenCommandHandler(Bundle globals) {
    super(globals);
    mSeenUsers = Collections.synchronizedMap(new HashMap<String, SeenData>());
    mUpdater = new SeenDataUpdater();
}

From source file:org.deeplearning4j.clustering.cluster.ClusterSet.java

public ClusterSet(String distanceFunction, boolean inverse) {
    this.distanceFunction = distanceFunction;
    this.inverse = inverse;
    this.clusters = Collections.synchronizedList(new ArrayList<Cluster>());
    this.pointDistribution = Collections.synchronizedMap(new HashMap<String, String>());
}

From source file:fr.aliasource.index.core.SearchDirector.java

public SearchDirector(IIndexingParameters parameters) {
    logger = LogFactory.getLog(getClass());
    crawlers = Collections.synchronizedMap(new HashMap<String, ICrawler>());
    runnables = Collections.synchronizedMap(new HashMap<ICrawler, RunnableCrawler>());
    runningCrawlers = Collections.synchronizedMap(new HashMap<String, Thread>());
    idxMgr = new IndexManager(parameters);
    stopped = false;//from w  w w . j a  v  a  2s  .  c  o m
    this.parameters = parameters;
    registerCrawlers();
    logger.info("SearchDirector created.");
}

From source file:fr.aliasource.webmail.server.LoginImpl.java

public LoginImpl() {
    FrontEndConfig fec = new FrontEndConfig();
    cfg = new ProxyConfig(Collections.synchronizedMap(fec.get()));
    try {//from   w  ww.jav  a 2  s  .c  o m
        proxyClientFactory = (IProxyClientFactory) Class.forName(cfg.getProxyClientFactoryClass())
                .newInstance();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}

From source file:org.apache.roller.weblogger.util.cache.LRUCacheImpl.java

protected LRUCacheImpl(String id) {

    this.id = id;
    this.cache = Collections.synchronizedMap(new LRULinkedHashMap(100));
}

From source file:framework.retrieval.engine.pool.impl.IndexWriterPool.java

public IndexWriterPool(IIndexReaderPool indexReaderPool) {
    methodInterceptorPoolMap = Collections.synchronizedMap(new HashMap<String, IndexWriterProxy>());
    indexPathTypes = Collections.synchronizedSet(new HashSet<String>());
    this.indexReaderPool = indexReaderPool;
}