org.mmbase.cache
Class BlobCache

java.lang.Object
  extended by org.mmbase.cache.Cache<String,Object>
      extended by org.mmbase.cache.BlobCache
All Implemented Interfaces:
Map<String,Object>, CacheMBean, SizeMeasurable

public abstract class BlobCache
extends Cache<String,Object>

The 'blob cache' is used in MMObjectNode to cache small byte-array field values. it is a replacement for the 'handle cache' which was present in MMBase <1.8.

Since:
MMBase 1.8
Version:
$Id: BlobCache.java 36125 2009-06-18 09:39:38Z michiel $
Author:
Michiel Meeuwissen

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class org.mmbase.cache.Cache
lock, maxEntrySize
 
Constructor Summary
BlobCache(int size)
           
 
Method Summary
protected  int getDefaultMaxEntrySize()
          This has to be overridden by Caches which support max entry size.
 String getDescription()
          Gives a description for this cache type.
 String getKey(int nodeNumber, String fieldName)
           
 String getName()
          Returns a name for this cache type.
 Object put(String key, Object value)
          Like 'put' of LRUHashtable but considers if the cache is active or not.
 
Methods inherited from class org.mmbase.cache.Cache
checkCachePolicy, clear, contains, containsKey, containsValue, entrySet, equals, get, getAvarageValueLength, getByteSize, getByteSize, getCheapByteSize, getCount, getHits, getImplementation, getLock, getMaxEntrySize, getMaxSize, getMisses, getPuts, getRatio, getSize, getStats, hashCode, isActive, isEmpty, keySet, maxSize, putAll, putCache, remove, reset, setActive, setImplementation, setMaxEntrySize, setMaxSize, size, toString, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlobCache

public BlobCache(int size)
Method Detail

getDefaultMaxEntrySize

protected int getDefaultMaxEntrySize()
Description copied from class: Cache
This has to be overridden by Caches which support max entry size.

Overrides:
getDefaultMaxEntrySize in class Cache<String,Object>

getName

public String getName()
Description copied from class: Cache
Returns a name for this cache type. Default it is the class name, but this normally will be overriden.

Specified by:
getName in interface CacheMBean
Overrides:
getName in class Cache<String,Object>

getDescription

public String getDescription()
Description copied from class: Cache
Gives a description for this cache type. This can be used in cache overviews.

Specified by:
getDescription in interface CacheMBean
Overrides:
getDescription in class Cache<String,Object>

getKey

public final String getKey(int nodeNumber,
                           String fieldName)

put

public Object put(String key,
                  Object value)
Description copied from class: Cache
Like 'put' of LRUHashtable but considers if the cache is active or not.

Specified by:
put in interface Map<String,Object>
Overrides:
put in class Cache<String,Object>


MMBase 2.0-SNAPSHOT - null