Package java.util.concurrent

Examples of java.util.concurrent.ConcurrentHashMap$MapReduceKeysToIntTask


    outDataToConverters =
      new HashMap();//<String, List<Converter>>();
    dataFormats =
      new HashSet();//<String>
    fileExtensionTestConverters =
      new ConcurrentHashMap();//<String, List<ConverterPath>>();
    fileExtensionCompareConverters =
      new ConcurrentHashMap();//<String, ConverterPath>();
   
    deriveDataFormats(this.converters, this.dataFormats);
    associateConverters(this.converters, this.inDataToConverters, this.outDataToConverters);
    createConverterPaths(this.inDataToConverters, this.fileExtensionTestConverters, this.fileExtensionCompareConverters);
  }
View Full Code Here


    bw.flush();
  }
 
  private Map assembleNodesSet(){
   
    Map nodesToInt = new ConcurrentHashMap();
 
    TreeSet nodeNameList = new TreeSet();
   
    //for each unique data format
    Iterator formatIter = this.dataFormats.iterator();
    while (formatIter.hasNext()) {
      String dataFormat = (String) formatIter.next();
     
      //add the data format string to our list of node names
      nodeNameList.add(dataFormat);
     
      List inConvs = (List)this.inDataToConverters.get(dataFormat);
      List outConvs = (List) this.outDataToConverters.get(dataFormat);
     
      Set convs = new HashSet();
     
      if (inConvs != null) {
        convs.addAll(inConvs);
      }
      if (outConvs != null) {
        convs.addAll(outConvs);
      }
     
      Iterator convIter = convs.iterator();
      //for each converter that inputs or outputs this data format...
      while (convIter.hasNext()) {
        Converter c = (Converter) convIter.next();
        //add the name of the converter to our list of node names
        nodeNameList.add(c.getShortName());
      }
    }
   
    String[] names = new String[nodeNameList.size()];
    names = (String[])nodeNameList.toArray(names);
   
    //for each node name in our list of node names ...
    for(int i = 0; i < names.length; i++){
      //associate that name with a unique integer in our map
      nodesToInt.put(names[i], new Integer(i+1));
    }
   
    //return our map of nodes to unique integers
    return nodesToInt;
  }
View Full Code Here

        if (fieldType.isInterface()) {
            if (fieldType == Map.class || fieldType == ObservableMap.class) {
                Class[] genericTypes = ChronicleTools.getGenericTypes(field.getGenericType(), 2);
                Map underlying = (Map) field.get(model);
                if (underlying == null)
                    underlying = new ConcurrentHashMap();
                MapWrapper map = new MapWrapper(this, field.getName(), genericTypes[0], genericTypes[1], underlying, 1024);
                Annotation[] annotations = field.getAnnotations();
                if (annotations != null)
                    map.setAnnotations(annotations);
                field.set(model, map);

            } else if (fieldType == List.class || fieldType == ObservableList.class) {
                Class[] genericTypes = ChronicleTools.getGenericTypes(field.getGenericType(), 1);
                List underlying = (List) field.get(model);
                if (underlying == null)
                    underlying = Collections.synchronizedList(new ArrayList());
                ListWrapper list = new ListWrapper(this, field.getName(), genericTypes[0], underlying, 1024);
                Annotation[] annotations = field.getAnnotations();
                if (annotations != null)
                    list.setAnnotations(annotations);
                field.set(model, list);

            } else if (fieldType == Set.class || fieldType == ObservableSet.class) {
                Class[] genericTypes = ChronicleTools.getGenericTypes(field.getGenericType(), 1);
                Set underlying = (Set) field.get(model);
                if (underlying == null)
                    underlying = Collections.newSetFromMap(new ConcurrentHashMap());
                SetWrapper set = new SetWrapper(this, field.getName(), genericTypes[0], underlying, 1024);
                Annotation[] annotations = field.getAnnotations();
                if (annotations != null)
                    set.setAnnotations(annotations);
                field.set(model, set);
View Full Code Here

  public static Map getMapObj(Class<?> clazz) {
    if (clazz.isInterface()) {
      if (clazz.isAssignableFrom(Map.class))
        return new HashMap();
      else if (clazz.isAssignableFrom(ConcurrentMap.class))
        return new ConcurrentHashMap();
      else if (clazz.isAssignableFrom(SortedMap.class))
        return new TreeMap();
      else if (clazz.isAssignableFrom(NavigableMap.class))
        return new TreeMap();
      else if (clazz.isAssignableFrom(ConcurrentNavigableMap.class))
View Full Code Here

        if (sipStack.isLoggingEnabled()) {
            sipStack.getStackLogger().logDebug("Creating clientTransaction " + this);
            sipStack.getStackLogger().logStackTrace();
        }
        // this.startTransactionTimer();
        this.sipDialogs = new ConcurrentHashMap();
    }
View Full Code Here

    }

    serializer = loadSerializer(cl);

    if (_cachedSerializerMap == null)
      _cachedSerializerMap = new ConcurrentHashMap(8);

    _cachedSerializerMap.put(cl, serializer);

    return serializer;
  }
View Full Code Here

    }

    deserializer = loadDeserializer(cl);

    if (_cachedDeserializerMap == null)
      _cachedDeserializerMap = new ConcurrentHashMap(8);

    _cachedDeserializerMap.put(cl, deserializer);

    return deserializer;
  }
View Full Code Here

                                                        .getProperty(WSDLQueryHandler.class.getName()
                                                                     + ".Schemas"));

            if (mp == null) {
                endpointInfo.getService().setProperty(WSDLQueryHandler.class.getName(),
                                                      new ConcurrentHashMap());
                mp = CastUtils.cast((Map)endpointInfo.getService()
                                    .getProperty(WSDLQueryHandler.class.getName()));
            }
            if (smp == null) {
                endpointInfo.getService().setProperty(WSDLQueryHandler.class.getName()
                                                      + ".Schemas",
                                                      new ConcurrentHashMap());
                smp = CastUtils.cast((Map)endpointInfo.getService()
                                    .getProperty(WSDLQueryHandler.class.getName()
                                                 + ".Schemas"));
            }
           
View Full Code Here

    /**
     *
     */
    public DefaultExclusionManager() {
        cache = new ConcurrentHashMap();
    }
View Full Code Here

                            float loadFactor) {
        if (!(loadFactor > 0)) {
            throw new IllegalArgumentException("Illegal Load factor: " +
                                               loadFactor);
        }
        this.delegate = new ConcurrentHashMap(initialCapacity, loadFactor, DEFAULT_CONCURRENCY);
        if (factory == null) {
            throw new IllegalArgumentException(
                "FutureResultDataAccessorFactory must not be null");
        }
        this.futureResultFactory = factory;
View Full Code Here

TOP

Related Classes of java.util.concurrent.ConcurrentHashMap$MapReduceKeysToIntTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.