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.mimacom.sample.integration.patterns.user.service.web.BulkHeadedUserController.java

public BulkHeadedUserController(BulkHeadedSearchServiceIntegration bulkHeadedSearchServiceIntegration) {
    this.asyncSearchServiceIntegration = bulkHeadedSearchServiceIntegration;
    this.userRepository = new ConcurrentHashMap<>();
}

From source file:channellistmaker.dataextractor.AbstractAllEPGFileExtractor.java

/**
 * ????XML?? getExtractor()?????????????
 *
 * @return ???// ww w.  j  av a2 s .  com
 */
public final synchronized Map<MultiKey<Integer>, T> getAllEPGRecords() {
    Map<MultiKey<Integer>, T> temp1 = new ConcurrentHashMap<>();
    LOG.info("XML? = " + this.EPGXMLs.size());
    for (Document D : this.EPGXMLs) {
        Map<MultiKey<Integer>, T> temp2;
        temp2 = this.getExtractor(D).makeMap();
        temp1.putAll(temp2);
    }
    return Collections.unmodifiableMap(temp1);
}

From source file:org.apache.oodt.cas.product.jaxrs.filters.BackwardsCompatibleInterceptor.java

@Override
public void handleMessage(Message message) throws Fault {
    String base = (String) message.get(Message.BASE_PATH);
    String uri = (String) message.get(Message.REQUEST_URI);
    String query = (String) message.get(Message.QUERY_STRING);

    base += base.endsWith("/") ? "" : "/";
    String request = uri.replaceAll("^" + base, "");

    // Parse the query string into a map of parameters.
    // [Note: this will overwrite multiple parameters that have the same name.]
    List<NameValuePair> params = URLEncodedUtils.parse(query, Charset.forName("UTF-8"));
    Map<String, String> map = new ConcurrentHashMap<String, String>();
    for (NameValuePair pair : params) {
        map.put(pair.getName(), pair.getValue());
    }//w ww  .  j  ava 2s  .co  m

    // Maps "data?productID=<product ID>" URI to either
    // "reference.file?productId=<product ID>" or
    // "product.zip?productId=<product ID>"
    if (request.equals("data")) {
        String format = map.get("format");
        request = "application/x-zip".equals(format) || "application/zip".equals(format) ? "product.zip"
                : "reference.file";

        query = "productId=" + map.get("productID");
        query += map.containsKey("refIndex") ? "&refIndex=" + map.get("refIndex") : "";
    }

    // Maps "dataset?typeID=<product type ID>" to
    // "dataset.zip?productTypeId=<product type ID>"
    else if (request.equals("dataset") && map.containsKey("typeID")) {
        request = "dataset.zip";
        query = "productTypeId=" + map.get("typeID");
    }

    // Maps "rdf?type=ALL" or "rdf?id=<product type ID>" to
    // "dataset.rdf?productTypeId=<ALL or product type ID>"
    else if (request.equals("rdf")) {
        request = "dataset.rdf";
        String type = map.get("type");
        query = "productTypeId=";
        query += "ALL".equals(type) ? type : map.get("id");
    }

    // Maps "rdf/dataset?type=ALL" or "rdf/dataset?typeID=<product type ID>" to
    // "dataset.rdf?productTypeId=<ALL or product type ID>"
    else if (request.equals("rdf/dataset")) {
        request = "dataset.rdf";
        String type = map.get("type");
        query = "productTypeId=";
        query += "ALL".equals(type) ? type : map.get("typeID");
        query += map.containsKey("filter") ? "&filter=" + map.get("filter") : "";
    }

    // Maps "viewRecent?channel=ALL" or "viewRecent?id=<product type ID>" to
    // "dataset.rss?productTypeId=<ALL or product type ID>"
    else if (request.equals("viewRecent")) {
        request = "dataset.rss";
        String channel = map.get("channel");
        query = "productTypeId=";
        query += "ALL".equals(channel) ? channel : map.get("id");
        query += map.containsKey("topn") ? "&limit=" + map.get("topn") : "";
    }

    // Maps "viewTransfers" to "transfers.rss?productId=ALL"
    else if (request.equals("viewTransfers")) {
        request = "transfers.rss";
        query = "productId=ALL";
    }

    // Store the new URI and query in the message map.
    uri = base + request;
    message.put(Message.REQUEST_URI, uri);
    message.put(Message.QUERY_STRING, query);
}

From source file:acromusashi.stream.hook.AmLogServerAdapter.java

/**
 * Default constructor//from   w  ww  .j  av a 2 s.c  om
 */
private AmLogServerAdapter() {
    this.mapper = new ObjectMapper();
    mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
    this.sessions = new ConcurrentHashMap<>();
    this.handler = new AmLogSendHandler();
}

From source file:org.lareferencia.backend.tasks.SnapshotManager.java

public SnapshotManager() {
    workersBySnapshotID = new ConcurrentHashMap<Long, ISnapshotWorker>();
}

From source file:org.wrml.runtime.format.application.schema.json.JsonSchemaLoader.java

public JsonSchemaLoader() {

    _JsonSchemas = new ConcurrentHashMap<URI, JsonSchema>();
}

From source file:io.watchcat.node.monitoring.DiskMonitor.java

public DiskMonitor() {
    diskUsageEvents = new ConcurrentHashMap<String, CriticalityEvent>();
}

From source file:de.fhg.iais.cortex.storage.filesystem.ComponentMapper.java

private ComponentMapper() {
    this.componentMappingMap = new ConcurrentHashMap<String, ComponentMapping>();
}

From source file:com.lovejoy777sarootool.rootool.preview.IconPreview.java

public IconPreview(Activity activity) {
    mContext = activity;//from  w w  w. j  av  a2s. c  o m
    mWidth = (int) mContext.getResources().getDimension(R.dimen.item_height);
    cache = new ConcurrentHashMap<String, Bitmap>();
    pool = Executors.newFixedThreadPool(5);
    mResources = activity.getResources();
    pm = mContext.getPackageManager();

    if (mMimeTypeIconCache == null) {
        mMimeTypeIconCache = new DrawableLruCache<String>();
    }
}

From source file:gr.ellak.ma.emergencyroad.PersistentCookieStore.java

/**
 * Construct a persistent cookie store./*from   w  ww.  j a va 2  s . co  m*/
 *
 * @param context Context to attach cookie store to
 */
public PersistentCookieStore(Context context) {
    cookiePrefs = context.getSharedPreferences(COOKIE_PREFS, 0);
    cookies = new ConcurrentHashMap<>();

    // Load any previously stored cookies into the store
    String storedCookieNames = cookiePrefs.getString(COOKIE_NAME_STORE, null);
    if (storedCookieNames != null) {
        String[] cookieNames = TextUtils.split(storedCookieNames, ",");
        for (String name : cookieNames) {
            String encodedCookie = cookiePrefs.getString(COOKIE_NAME_PREFIX + name, null);
            if (encodedCookie != null) {
                Cookie decodedCookie = decodeCookie(encodedCookie);
                if (decodedCookie != null) {
                    cookies.put(name, decodedCookie);
                }
            }
        }

        // Clear out expired cookies
        clearExpired(new Date());
    }
}