Package org.apache.commons.collections.map

Examples of org.apache.commons.collections.map.ReferenceMap$Entry


            session.setAttribute(LISTENER_REGISTERED, Boolean.TRUE);
        }
        Set listeners = (Set)session.getAttribute(LISTENER_REGISTRY);
        if (listeners == null) {
            listeners = MapBackedSet.decorate
                (new ReferenceMap (ReferenceMap.WEAK, ReferenceMap.HARD, true),
                 new Object());
            session.setAttribute(LISTENER_REGISTRY, listeners);
        }
        listeners.add (pl);
    }
View Full Code Here


     */
    // XXX is this thread safe?
    Map<String, ChannelCacheEntry> getChannelCache() {
        if (this.channelCache == null) {
            if ((this.channelCache = this.cacheTables.get(this.channel)) == null) {
                this.channelCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT, 2, .75f, true);
                this.cacheTables.put(this.channel, this.channelCache);
            }
        }
        return this.channelCache;
    }
View Full Code Here

    private IPersonAttributeDao pa;
    private Map<String, Map<String, List<Object>>> cache;

    public PersonDirPropertyFinder() {
        pa = PersonDirectory.getPersonAttributeDao();
        cache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT, 120, .75f, true);
    }
View Full Code Here

     * Cache objects for each request
     */
    private final class MapCachingCacheLoader extends MapCachingDoubleCheckedCreator<String, Cache> {
        @SuppressWarnings("unchecked")
        private MapCachingCacheLoader() {
            super(new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK));
        }
View Full Code Here

        return (Map<K, V>) this.mapCacheCreator.get(cacheName);
    }

    private class MapCacheCreator extends MapCachingDoubleCheckedCreator<String, Map<?, ?>> {
        public MapCacheCreator() {
            super(new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT));
        }
View Full Code Here

        return this.entityCacheCreator.get(entityType);
    }

    private class EntityCacheCreator extends MapCachingDoubleCheckedCreator<String, IEntityCache> {
        public EntityCacheCreator() {
            super(new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT));
        }
View Full Code Here

            if (_oldSerializedViews == null && context != null)
            {
                String cacheMode = getCacheOldViewsInSessionMode(context);
                if (CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.WEAK, AbstractReferenceMap.WEAK, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.WEAK, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.SOFT, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.SOFT);
                }
            }
           
            return _oldSerializedViews;
        }
View Full Code Here

            if (_oldSerializedViews == null && context != null)
            {
                String cacheMode = getCacheOldViewsInSessionMode(context);
                if (CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.WEAK, AbstractReferenceMap.WEAK, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.WEAK, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.SOFT, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.SOFT);
                }
            }
           
            return _oldSerializedViews;
        }
View Full Code Here

            if (_oldSerializedViews == null && context != null)
            {
                String cacheMode = getCacheOldViewsInSessionMode(context);
                if (CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.WEAK, AbstractReferenceMap.WEAK, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.WEAK, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.SOFT, true);
                }
                else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT.equals(cacheMode))
                {
                    _oldSerializedViews = new ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.SOFT);
                }
            }
           
            return _oldSerializedViews;
        }
View Full Code Here

   */
  private synchronized void init() {
    if (this.objectCache == null)
      this.objectCache =
        Collections.synchronizedMap(
          new ReferenceMap(ReferenceMap.SOFT, ReferenceMap.SOFT));
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.map.ReferenceMap$Entry

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.