Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.CacheMap$ValueCollection


    /**
     * Return the map to use as an internal cache.
     */
    protected CacheMap newCacheMap() {
        return new CacheMap();
    }
View Full Code Here


    /**
     * 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

            }

            if (cache instanceof DelegatingDataCache)
                cache = ((DelegatingDataCache) cache).getInnermostDelegate();
            if (cache instanceof ConcurrentDataCache) {
                CacheMap map = ((ConcurrentDataCache) cache).getCacheMap();
                map.setCacheSize(3);
                map.setSoftReferenceSize(0);
            } else if (cache instanceof ConcurrentDataCache) {
                CacheMap map = ((ConcurrentDataCache) cache).getCacheMap();
                map.setCacheSize(3);
                map.setSoftReferenceSize(0);
            }

            startTx(em);
            CacheObjectH h = new CacheObjectH("h");
            em.persist(h);
View Full Code Here

    /**
     * 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

    /**
     * Return the map to use as an internal cache.
     */
    protected CacheMap newCacheMap() {
        return new CacheMap();
    }
View Full Code Here

     * query cache.
     *
     */
    protected int queryCacheGet() {
        ConcurrentQueryCache dcache = getQueryCache();
        CacheMap map = dcache.getCacheMap();
        return map.size();
    }
View Full Code Here

            }

            if (cache instanceof DelegatingDataCache)
                cache = ((DelegatingDataCache) cache).getInnermostDelegate();
            if (cache instanceof ConcurrentDataCache) {
                CacheMap map = ((ConcurrentDataCache) cache).getCacheMap();
                map.setCacheSize(3);
                map.setSoftReferenceSize(0);
            }

            startTx(em);
            CacheObjectH h = new CacheObjectH("h");
            em.persist(h);
View Full Code Here

            }

            if (cache instanceof DelegatingDataCache)
                cache = ((DelegatingDataCache) cache).getInnermostDelegate();
            if (cache instanceof ConcurrentDataCache) {
                CacheMap map = ((ConcurrentDataCache) cache).getCacheMap();
                map.setCacheSize(3);
                map.setSoftReferenceSize(0);
            } else if (cache instanceof ConcurrentDataCache) {
                CacheMap map = ((ConcurrentDataCache) cache).getCacheMap();
                map.setCacheSize(3);
                map.setSoftReferenceSize(0);
            }

            startTx(em);
            CacheObjectH h = new CacheObjectH("h");
            em.persist(h);
View Full Code Here

    /**
     * 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

    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

TOP

Related Classes of org.apache.openjpa.util.CacheMap$ValueCollection

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.