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.ushahidi.swiftriver.core.dropqueue.MetadataResponseHandlerTest.java

@Before
public void setup() {
    dropsMap = new HashMap<String, RawDrop>();
    publishQueue = new LinkedBlockingQueue<RawDrop>();
    dropFilterQueue = new LinkedBlockingQueue<String>();
    deliveryFramesMap = new ConcurrentHashMap<String, DeliveryFrame>();

    metadataResponseHandler = new MetadataResponseHandler();
    metadataResponseHandler.setDropsMap(dropsMap);
    metadataResponseHandler.setObjectMapper(objectMapper);
    metadataResponseHandler.setPublishQueue(publishQueue);
    metadataResponseHandler.setDropFilterQueue(dropFilterQueue);
    metadataResponseHandler.setDeliveryFramesMap(deliveryFramesMap);
}

From source file:m.c.m.proxyma.context.ProxymaContext.java

/**
 * Default constructor for this Class//w  ww.ja va2  s . c  om
 *
 * @param contextName the name of the context to create
 * @param contextBaseURI Base URI of the context
 * @param configurationFile proxyma configuration file to load
 * @param logsDirectoryPath directory where to write all the logs
 */
public ProxymaContext(String contextName, String contextBaseURI, String configurationFile,
        String logsDirectoryPath) {
    // Initialize private attributes
    try {
        this.contextName = contextName;
        this.proxymaContextBasePath = contextBaseURI;
        this.logsDirectoryPath = logsDirectoryPath;
        proxyFoldersByURLEncodedName = new ConcurrentHashMap<String, ProxyFolderBean>();
        proxyFoldersByDestinationHost = new ConcurrentHashMap<String, LinkedList<ProxyFolderBean>>();
        config = new XMLConfiguration(configurationFile);
        config.setExpressionEngine(new XPathExpressionEngine());
        if (this.log == null) {
            //create a unique logger for the whole context
            String name = ProxymaTags.DEFAULT_LOGGER_PREFIX + "." + contextName;
            this.log = Logger.getLogger(name);

            String logFile = logsDirectoryPath + "proxyma-" + contextName + ".log";
            String level = getSingleValueParameter(ProxymaTags.GLOBAL_LOGLEVEL);
            int maxSize = Integer.parseInt(getSingleValueParameter(ProxymaTags.GLOBAL_LOGFILE_MAXSIZE));
            int retention = Integer.parseInt(getSingleValueParameter(ProxymaTags.GLOBAL_LOGFILES_RETENTION));
            ProxymaLoggersUtil.initializeContextLogger(this.log, logFile, level, maxSize, retention);
        }
        this.defaultEncoding = getSingleValueParameter(ProxymaTags.GLOBAL_DEFAULT_ENCODING);
        this.proxymaVersion = "Proxyma-NG (Rel. " + getSingleValueParameter(ProxymaTags.CONFIG_FILE_VERSION)
                + ")";
    } catch (Exception ex) {
        Logger.getLogger("").log(Level.SEVERE, null, ex);
    }
}

From source file:com.mirth.connect.model.MessageObject.java

public MessageObject() {
    this.connectorMap = new ConcurrentHashMap();
    this.responseMap = new ConcurrentHashMap();
    this.channelMap = new ConcurrentHashMap();

    this.context = new HashMap<String, Object>();

    this.status = Status.UNKNOWN;
}

From source file:edu.isi.karma.kr2rml.writer.N3KR2RMLRDFWriter.java

public N3KR2RMLRDFWriter(URIFormatter uriFormatter, OutputStream outputStream) {
    this.outWriter = new PrintWriter(outputStream);
    this.uriFormatter = uriFormatter;
    generatedTriples = new ConcurrentHashMap<>();
    baseURI = null;/*from  w w  w  .  j ava2 s  . c om*/
}

From source file:cn.org.eshow.framwork.soap.AbSoapParams.java

/**
 * ?.
 */
private void init() {
    params = new ConcurrentHashMap<String, String>();
}

From source file:com.smartitengineering.jetty.session.replication.SessionData.java

public SessionData(SessionDataId dataId, String lastNode) {
    if (StringUtils.isBlank(lastNode)) {
        throw new IllegalArgumentException("Null node");
    }// w  w w . ja va  2s  . co  m
    if (dataId == null) {
        throw new IllegalArgumentException("Null session data id");
    }
    id = dataId;
    created = System.currentTimeMillis();
    accessed = created;
    lastAccessed = accessed;
    this.lastNode = lastNode;
    attributes = new ConcurrentHashMap();
}

From source file:com.gwtplatform.dispatch.rpc.server.spring.actionhandlervalidator.LazyActionHandlerValidatorRegistryImpl.java

public LazyActionHandlerValidatorRegistryImpl() {
    actionHandlerValidatorClasses = new ConcurrentHashMap<Class<? extends Action<?>>, ActionHandlerValidatorClass<? extends Action<?>, ? extends Result>>();
    actionHandlerValidatorInstances = new ConcurrentHashMap<Class<? extends Action<?>>, ActionHandlerValidatorInstance>();
    validators = new ConcurrentHashMap<Class<? extends ActionValidator>, ActionValidator>();
}

From source file:io.cloudslang.lang.tools.build.tester.parallel.report.ThreadSafeRunTestResults.java

public ThreadSafeRunTestResults() {
    this.passedTests = new ConcurrentHashMap<>();
    this.failedTests = new ConcurrentHashMap<>();
    this.skippedTests = new ConcurrentHashMap<>();
    this.coveredExecutables = new TreeSet<>();
    this.uncoveredExecutables = new TreeSet<>();
    this.exceptions = new ConcurrentLinkedDeque<>();

    this.lockCoveredExecutables = new Object();
    this.lockUncoveredExecutables = new Object();
}

From source file:org.mimacom.sample.integration.patterns.user.service.web.HystrixUserController.java

public HystrixUserController(HystrixSearchServiceIntegration hystrixSearchServiceIntegration) {
    this.hystrixSearchServiceIntegration = hystrixSearchServiceIntegration;
    this.userRepository = new ConcurrentHashMap<>();
}

From source file:org.ng200.openolympus.services.TaskContainerCache.java

@Autowired
public TaskContainerCache(final StorageService storageService) {
    this.taskContainers = new ConcurrentHashMap<>();
    this.storageService = storageService;
    this.executorService.scheduleAtFixedRate(() -> {
        this.taskContainers.forEach((id, taskContainer) -> taskContainer.collectGarbage(this.solutionService));
    }, 10, 10, TimeUnit.SECONDS);
}