org.exist.collections
Class CollectionCache

java.lang.Object
  extended byorg.exist.storage.cache.GClockCache
      extended byorg.exist.storage.cache.LRDCache
          extended byorg.exist.collections.CollectionCache
All Implemented Interfaces:
Cache

public class CollectionCache
extends LRDCache

Global cache for Collection objects. The cache is owned by CollectionStore. It is not synchronized. Thus a lock should be obtained on the collection store before accessing the cache.

Author:
wolf

Field Summary
 
Fields inherited from class org.exist.storage.cache.LRDCache
totalReferences
 
Fields inherited from class org.exist.storage.cache.GClockCache
accounting, cacheManager, count, growthFactor, hitsOld, items, map, size, used
 
Fields inherited from interface org.exist.storage.cache.Cache
LOG
 
Constructor Summary
CollectionCache(BrokerPool pool, int blockBuffers, double growthThreshold)
           
 
Method Summary
 void add(Collection collection)
           
 void add(Collection collection, int initialRefCount)
           
 Collection get(Collection collection)
           
 Collection get(java.lang.String name)
           
 void remove(Cacheable item)
          Remove an item from the cache.
protected  Cacheable removeOne(Cacheable item)
          Overwritten to lock collections before they are removed.
 void resize(int newSize)
          Resize the cache.
 
Methods inherited from class org.exist.storage.cache.LRDCache
add, ageReferences, cleanup
 
Methods inherited from class org.exist.storage.cache.GClockCache
add, flush, get, get, getBuffers, getFails, getFileName, getGrowthFactor, getHits, getLoad, getThrashing, getUsedBuffers, hasDirtyItems, setCacheManager, setFileName, shrink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionCache

public CollectionCache(BrokerPool pool,
                       int blockBuffers,
                       double growthThreshold)
Method Detail

add

public void add(Collection collection)

add

public void add(Collection collection,
                int initialRefCount)

get

public Collection get(Collection collection)

get

public Collection get(java.lang.String name)

removeOne

protected Cacheable removeOne(Cacheable item)
Overwritten to lock collections before they are removed.

Overrides:
removeOne in class LRDCache

remove

public void remove(Cacheable item)
Description copied from interface: Cache
Remove an item from the cache.

Specified by:
remove in interface Cache
Overrides:
remove in class GClockCache

resize

public void resize(int newSize)
Description copied from interface: Cache
Resize the cache. This method is called by the CacheManager. The newSize parameter can either be larger or smaller than the current cache size.

Specified by:
resize in interface Cache
Overrides:
resize in class GClockCache


<oXygen/> XML Editor provides support for editing and debugging XQuery expressions against the eXist XML Database.