Examples of CacheMap


Examples of org.apache.openjpa.util.CacheMap

    /**
     * Return the map to use as an internal cache; entry expirations must
     * invoke {@link AbstractDataCache#keyRemoved}.
     */
    protected CacheMap newCacheMap() {
        return new CacheMap() {
            protected void entryRemoved(Object key, Object value,
                boolean expired) {
                keyRemoved(key, expired);
            }
        };
View Full Code Here

Examples of org.apache.openjpa.util.CacheMap

    protected void removeAllInternal(Class<?> cls, boolean subs) {
        // The performance in this area can be improved upon, however it seems
        // unlikely that this method will be called in a performance intensive
        // environment. In any event applications can revert to the old behavior
        // by simply calling removeAll().
        CacheMap orig = _cache;
        _cache = newCacheMap();
        for (Object o : orig.values()) {
            Class<?> curClass = ((DataCachePCData) o).getType();
            if (subs) {
                if (cls == curClass || (cls != null && cls.isAssignableFrom(curClass))) {
                    orig.remove(((DataCachePCData) o).getId());
                }
            }
        }
        _cache.putAll(orig, false);
    }
View Full Code Here

Examples of org.knopflerfish.util.CacheMap

    public RemotingClient(String servicePath) {
        this.servicePath = servicePath;
        callLock = new Object();
        caches = new HashMap();
       
        fastCache = new CacheMap(1000);
        slowCache = new CacheMap(10000);
    }
View Full Code Here

Examples of org.zkoss.util.CacheMap

  public String getDownloadMediaURI(Media media, String pathInfo) {
    if (media == null)
      throw new IllegalArgumentException("null media");

    if (_meds == null) {
      _meds = new CacheMap();
      _meds.setMaxSize(1024);
      _meds.setLifetime(15 * 60 * 1000);
        //15 minutes (CONSIDER: configurable)
    } else {
      housekeep();
View Full Code Here

Examples of org.zkoss.util.CacheMap

    final String PGPATH_CACHE = "org.zkoss.web.pgpath.cache";
    Map map = (Map)ctx.getAttribute(PGPATH_CACHE);
    if (map == null) {
      map = Collections.synchronizedMap( //10 min
        new CacheMap(500, 10*60*1000));
      ctx.setAttribute(PGPATH_CACHE, map);
    }

    final Locale locale = Locales.getCurrent();
    final URIIndex index = new URIIndex(pgpath, locale);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.