Package org.exist.storage.cache

Examples of org.exist.storage.cache.Cacheable


    protected void removeOne(Cacheable item) {
        boolean removed = false;
        SequencedLongHashMap.Entry<Cacheable> next = map.getFirstEntry();
        int tries = 0;
        do {
            final Cacheable cached = next.getValue();
            if(cached.getKey() != item.getKey()) {
                final Collection old = (Collection) cached;
                final Lock lock = old.getLock();
                if (lock.attempt(Lock.READ_LOCK)) {
                    try {
                        if (cached.allowUnload()) {
                            if(pool.getConfigurationManager()!=null) { // might be null during db initialization
                                pool.getConfigurationManager().invalidate(old.getURI(), null);
                            }
                            names.remove(old.getURI().getRawCollectionPath());
                            cached.sync(true);
                            map.remove(cached.getKey());
                            removed = true;
                        }
                    } finally {
                        lock.release(Lock.READ_LOCK);
                    }
View Full Code Here


        } else {
            LOG.debug("Growing collection cache to " + newSize);
            SequencedLongHashMap<Cacheable> newMap = new SequencedLongHashMap<Cacheable>(newSize * 2);
            Object2LongHashMap newNames = new Object2LongHashMap(newSize);
            SequencedLongHashMap.Entry<Cacheable> next = map.getFirstEntry();
            Cacheable cacheable;
            while(next != null) {
                cacheable = next.getValue();
                newMap.put(cacheable.getKey(), cacheable);
                newNames.put(((Collection) cacheable).getURI().getRawCollectionPath(), cacheable.getKey());
                next = next.getNext();
            }
            max = newSize;
            map = newMap;
            names = newNames;
View Full Code Here

TOP

Related Classes of org.exist.storage.cache.Cacheable

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.