Package com.google.common.collect

Examples of com.google.common.collect.MapMaker$LinkedWeakEntry


  private ApplicationDataMapDb buildApplicationDataTemplate(ApplicationDb application, String personId, String count) {
    ApplicationDataMapDb applicationDataMap = new ApplicationDataMapDb();
    applicationDataMap.setApplication(application);
    applicationDataMap.setPersonId(personId);
    Map<String, String> values = new MapMaker().makeMap();
    if (null != count) {
      values.put("count", count);
    }
    applicationDataMap.setValues(values);
    return applicationDataMap;
View Full Code Here


      mediaItem2.setUrl("http://www.archive.org/download/testmp3testfile/mpthreetest.mp3");
      mediaItems.add(mediaItem1);
      mediaItems.add(mediaItem2);
      activity.setMediaItems(mediaItems);
      activity.setPostedTime(1111111111L);
      Map<String, String> templateParams = new MapMaker().makeMap();
      templateParams.put("small", "true");
      templateParams.put("otherContent", "and got wet");
      activity.setTemplateParams(templateParams);
      activity.setTitle("My trip");
      activity.setTitleId("1");
      activity.setUpdated(new Date());
      activity.setUrl("http://www.example.org/canonical/activities/1");

    } else if ("2".equals(id)) {
      activity.setBody("Went skiing");
      activity.setBodyId("2");
      activity.setExternalId("http://www.example.org/123457");
      List<MediaItem> mediaItems = new ArrayList<MediaItem>();
      activity.setMediaItems(mediaItems);
      activity.setPostedTime(1111111112L);
      Map<String, String> templateParams = new MapMaker().makeMap();
      templateParams.put("small", "true");
      templateParams.put("otherContent", "and went fast");
      activity.setTemplateParams(templateParams);
      activity.setTitle("My next trip");
      activity.setTitleId("2");
View Full Code Here

    private final ComputeFunction<KEY, VALUE>       function;

    public RefreshMemoryMirror(Long period, ComputeFunction<KEY, VALUE> function){
        this.period = period;
        this.function = function;
        store = new MapMaker().makeMap();
    }
View Full Code Here

    private final Map<KEY, VALUE>             store;
    private final ComputeFunction<KEY, VALUE> function;

    public ExtensionMemoryMirror(ComputeFunction<KEY, VALUE> function){
        this.function = function;
        store = new MapMaker().makeMap();
    }
View Full Code Here

    // ================================ helper method ==========================

    private void initTables(final JdbcTemplate jdbcTemplate) {
        // soft引用设置,避免内存爆了
        GenericMapMaker mapMaker = null;
        mapMaker = new MapMaker().softValues().evictionListener(new MapEvictionListener<List<String>, Table>() {

            public void onEviction(List<String> names, Table table) {
                logger.warn("Eviction For Table:" + table);
            }
        });
View Full Code Here

            throw new ConfigException("nid is not set!");
        }

        this.nid = Long.valueOf(nid);

        channelMapping = new MapMaker().makeComputingMap(new Function<Long, Long>() {

            public Long apply(Long pipelineId) {
                // 处理下pipline -> channel映射关系不存在的情况
                FindChannelEvent event = new FindChannelEvent();
                event.setPipelineId(pipelineId);
View Full Code Here

     * @return The CloseableSet.
     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    protected final Set<Closeable> getCloseableSet() {
        if (closeables == null) {
            closeables = Collections.newSetFromMap((Map) new MapMaker()
                    .concurrencyLevel(1).weakKeys().makeMap());
        }
        return closeables;
    }
View Full Code Here

      Map<String, ClusterActionHandlerFactory> factoryMap =
          indexFactoriesByRolePrefix(checkNotNull(factories, "factories"));
      Map<String, ClusterActionHandler> handlerMap =
          indexHandlersByRole(checkNotNull(handlers, "handlers"));

      return new MapMaker().makeComputingMap(
        new ReturnHandlerByRoleOrPrefix(factoryMap, handlerMap));
   }
View Full Code Here

      private final ConcurrentMap<String, NodeMetadata> nodes;

      @SuppressWarnings("unused")
      @Inject
      public Factory(final ConcurrentMap<String, NodeMetadata> nodes) {
        this.clientMap = new MapMaker()
            .makeComputingMap(new Function<Key, SshClient>() {

              @Override
              public SshClient apply(Key key) {
                return new LogSshClient(key);
View Full Code Here

  {
    this.curatorFramework = curatorFramework;
    this.config = config;
    this.strategy = strategy;

    this.containers = new MapMaker().makeMap();
    this.uninitializedInventory = Sets.newConcurrentHashSet();

    this.cacheFactory = new SimplePathChildrenCacheFactory(true, true, new ShutdownNowIgnoringExecutorService(exec));
  }
View Full Code Here

TOP

Related Classes of com.google.common.collect.MapMaker$LinkedWeakEntry

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.