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:com.jivesoftware.os.tasmo.configuration.events.TenantEventsProvider.java

public TenantEventsProvider(TenantId masterTenantId, EventsProvider eventsProvider) {
    this.masterTenantId = masterTenantId;
    this.eventsProvider = eventsProvider;
    this.versionedEventsModels = new ConcurrentHashMap<>();
}

From source file:ai.susi.json.JsonMinifier.java

public JsonMinifier() {
    this.key2short = new ConcurrentHashMap<>();
    this.short2key = new ConcurrentHashMap<>();
}

From source file:com.ejisto.modules.repository.WebApplicationRepository.java

public WebApplicationRepository() {
    webApplications = new ConcurrentHashMap<>();
}

From source file:com.enonic.cms.web.portal.services.UserServicesAccessManagerImpl.java

public UserServicesAccessManagerImpl() {
    sitesAccessRules = new ConcurrentHashMap<SiteKey, ConcurrentMap<String, AccessPermission>>();
}

From source file:org.eclipse.ecf.internal.provider.filetransfer.httpclient4.HttpClientProxyCredentialProvider.java

public HttpClientProxyCredentialProvider() {
    cachedCredentials = new ConcurrentHashMap<AuthScope, Credentials>();
}

From source file:org.grails.datastore.mapping.core.AbstractAttributeStoringSession.java

public void setAttribute(Object entity, String attributeName, Object value) {
    if (entity == null) {
        return;//from w  ww  .j a  va2 s  .co m
    }

    int id = System.identityHashCode(entity);
    Map<String, Object> attrs = attributes.get(id);
    if (attrs == null) {
        attrs = new ConcurrentHashMap<String, Object>();
        attributes.put(id, attrs);
    }

    if (attributeName != null && value != null) {
        attrs.put(attributeName, value);
    }
}

From source file:com.ushahidi.swiftriver.core.rules.RulesRegistryTest.java

@Before
public void setUp() {
    rulesMap = new ConcurrentHashMap<Long, Map<Long, Rule>>();

    rulesRegistry = new RulesRegistry();
    rulesRegistry.setRulesMap(rulesMap);
    rulesRegistry.setRuleDao(ruleDao);//from w  ww.  j  av  a  2  s. c  o m
}

From source file:com.networknt.registry.support.command.CommandFailbackRegistry.java

public CommandFailbackRegistry(URL url) {
    super(url);//from   w  ww  . j  a v a  2 s.  c  om
    commandManagerMap = new ConcurrentHashMap<>();
    if (logger.isInfoEnabled())
        logger.info("CommandFailbackRegistry init. url: " + url.toSimpleString());
}

From source file:org.esigate.url.RoundRobinBaseUrlRetrieveStrategyTest.java

public void testGetBaseURL() {
    String[] baseUrls = new String[] { "http://example.com/test/", "http://example1.com/test/",
            "http://example2.com/test/" };
    BaseUrlRetrieveStrategy strategy = new RoundRobinBaseUrlRetrieveStrategy(baseUrls);
    IncomingRequest request = TestUtils.createIncomingRequest().build();
    int times = 5;
    int requestsCount = baseUrls.length * times;
    ConcurrentMap<String, AtomicInteger> counterMap = new ConcurrentHashMap<String, AtomicInteger>();
    for (int i = 0; i < requestsCount; i++) {
        String baseUrl = strategy.getBaseURL(request);
        counterMap.putIfAbsent(baseUrl, new AtomicInteger(0));
        counterMap.get(baseUrl).incrementAndGet();
    }/* w  w w . j  a v a  2  s.com*/
    for (String baseUrl : baseUrls) {
        assertEquals(times, counterMap.get(baseUrl).get());
    }
}

From source file:ch.algotrader.event.dispatch.MarketDataSubscriptionRegistry.java

public MarketDataSubscriptionRegistry() {
    this.marketDataSubscriptionMap = new ConcurrentHashMap<>();
}