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.cisco.oss.foundation.message.AbstractRabbitMQConcurrentMessageHandler.java

public AbstractRabbitMQConcurrentMessageHandler(String consumerName) {
    super(consumerName);
    onWorkIdentifierMap = new ConcurrentHashMap<String, Object>();
}

From source file:net.nfpj.webcounter.dm.MemCounterDM.java

public MemCounterDM() {
    counters = new ConcurrentHashMap<>();
}

From source file:com.madhouse.metrics.util.MetricsFactory.java

@PostConstruct
void init() {/*  ww w .j  av a2s .co m*/
    registry = new MetricRegistry();
    hashMap = new ConcurrentHashMap<String, Metric>();
    jmxReporter = JmxReporter.forRegistry(registry).build();
    jmxReporter.start();
}

From source file:ch.genevajug.crappy.serviceregistor.impl.ServiceRegistrator.java

/**
 * Default constructor, initializes internal state.
 */
public ServiceRegistrator() {
    serviceRegistrations = new ConcurrentHashMap<Long, ServiceRegistration>();
}

From source file:ch.algotrader.broker.JMSTopicPublisher.java

public JMSTopicPublisher(final ConnectionFactory connectionFactory, final MessageConverter converter) {
    this.eventTypeCache = new EventTypeCache();
    this.topicRouters = new ConcurrentHashMap<>();
    this.template = new JmsTemplate(connectionFactory);
    this.template.setMessageConverter(converter);
}

From source file:ch.algotrader.event.EventListenerRegistryImpl.java

public EventListenerRegistryImpl() {
    this.eventTypeCache = new EventTypeCache();
    this.listenerMap = new ConcurrentHashMap<>();
}

From source file:com.tealcube.minecraft.bukkit.config.MasterConfiguration.java

public MasterConfiguration() {
    settingMap = new ConcurrentHashMap<>();
}

From source file:com.bskyb.cg.environments.hash.PersistentHash.java

public PersistentHash(String dirname) throws IOException {
    this.dirname = dirname;

    hash = new ConcurrentHashMap<String, Message>();
    File directory = new File(dirname);

    if (directory.isDirectory()) {
        refreshFromStore(this.dirname);
    } else {/* www . ja  v a2 s.co  m*/
        createEmptyStore(this.dirname);
    }
}

From source file:com.weibo.api.motan.codec.AbstractCodec.java

protected static synchronized void initAllSerialziation() {
    if (serializations == null) {
        serializations = new ConcurrentHashMap<Integer, String>();
        try {/*w  w w .  j  a v  a 2  s. c om*/
            ExtensionLoader<Serialization> loader = ExtensionLoader.getExtensionLoader(Serialization.class);
            List<Serialization> exts = loader.getExtensions(null);
            for (Serialization s : exts) {
                String old = serializations.put(s.getSerializationNumber(), loader.getSpiName(s.getClass()));
                if (old != null) {
                    LoggerUtil.warn("conflict serialization spi! serialization num :"
                            + s.getSerializationNumber() + ", old spi :" + old + ", new spi :"
                            + serializations.get(s.getSerializationNumber()));
                }
            }
        } catch (Exception e) {
            LoggerUtil.warn("init all serialzaion fail!", e);
        }
    }
}

From source file:gov.nih.nci.integration.dao.DefaultServiceInvocationMessageDao.java

/**
 * getAllByReferenceMessageId//from  ww  w.j  a va2  s  . c om
 * 
 * @param refMsgId - messageId
 * @return Map
 */
@SuppressWarnings("unchecked")
public Map<StrategyIdentifier, ServiceInvocationMessage> getAllByReferenceMessageId(Long refMsgId) {
    final Query msgsQuery = this.getEm().createQuery("from " + getDomainClass().getSimpleName()
            + " svcInvMsg where svcInvMsg.referenceMessageId = :referenceMessageId ");
    msgsQuery.setParameter("referenceMessageId", refMsgId);
    final List<ServiceInvocationMessage> msgs = msgsQuery.getResultList();
    final ConcurrentHashMap<StrategyIdentifier, ServiceInvocationMessage> map = new ConcurrentHashMap<StrategyIdentifier, ServiceInvocationMessage>();
    for (ServiceInvocationMessage serviceInvocationMessage : msgs) {
        map.put(serviceInvocationMessage.getStrategyIdentifier(), serviceInvocationMessage);
    }

    return map;
}