org.mmbase.cache.oscache
Class OSCacheImplementation

java.lang.Object
  extended byorg.mmbase.cache.oscache.OSCacheImplementation
All Implemented Interfaces:
CacheImplementationInterface, Map

public class OSCacheImplementation
extends Object
implements CacheImplementationInterface

Implementation of the MMBase 'CacheImplementationInterface' interface, which delegates all calls to an OSCache implementation. This implementation accepts the following configuration properties:

To use this implementation, you can use a construction like this in your 'caches.xml' configuration file:
 <cache name="NodeListCache">
   <status>active</status>
   <size>3</size>
   <implementation>
     <class>org.mmbase.cache.oscache.OSCacheImplementation</class>
     <param name="path">/tmp</param>
   </implementation>
 </cache>
 

Author:
Johannes Verelst <johannes.verelst@eo.nl>

Nested Class Summary
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Constructor Summary
OSCacheImplementation()
           
 
Method Summary
 void clear()
          Wrapper around the clear() method of the cache implementation.
 void config(Map config)
          This method is called by MMBase to configure the cache using the given map of configuration parameters.
 boolean containsKey(Object key)
          Wrapper around the containsKey() method of the cache implementation.
 boolean containsValue(Object value)
          Wrapper around the containsValue() method of the cache implementation.
 Set entrySet()
          Wrapper around the entrySet() method of the cache implementation.
 boolean equals(Object o)
          Wrapper around the equals() method of the cache implementation.
 Object get(Object key)
          Wrapper around the get() method of the cache implementation.
 int getByteSize()
           
 int getByteSize(SizeOf sizeof)
           
 int getCount(Object key)
          Wrapper around the getCount() method of the cache implementation.
 int hashCode()
          Wrapper around the hashCode() method of the cache implementation.
 boolean isEmpty()
          Wrapper around the isEmpty() method of the cache implementation.
 Set keySet()
          Wrapper around the keySet() method of the cache implementation.
 int maxSize()
          Wrapper around the getMaxEntries() method of the cache implementation.
 Object put(Object key, Object value)
          Wrapper around the put() method of the cache implementation.
 void putAll(Map t)
          Wrapper around the putAll() method of the cache implementation.
 Object remove(Object key)
          Wrapper around the remove() method of the cache implementation.
 void setMaxSize(int size)
          Wrapper around the setMaxEntries() method of the cache implementation.
 int size()
          Wrapper around the size() method of the cache implementation.
 Collection values()
          Wrapper around the values() method of the cache implementation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSCacheImplementation

public OSCacheImplementation()
Method Detail

config

public void config(Map config)
This method is called by MMBase to configure the cache using the given map of configuration parameters.

Specified by:
config in interface CacheImplementationInterface

setMaxSize

public void setMaxSize(int size)
Wrapper around the setMaxEntries() method of the cache implementation.

Specified by:
setMaxSize in interface CacheImplementationInterface

maxSize

public int maxSize()
Wrapper around the getMaxEntries() method of the cache implementation.

Specified by:
maxSize in interface CacheImplementationInterface

getCount

public int getCount(Object key)
Wrapper around the getCount() method of the cache implementation. (not implemented)

Specified by:
getCount in interface CacheImplementationInterface

clear

public void clear()
Wrapper around the clear() method of the cache implementation.

Specified by:
clear in interface Map

containsKey

public boolean containsKey(Object key)
Wrapper around the containsKey() method of the cache implementation.

Specified by:
containsKey in interface Map

containsValue

public boolean containsValue(Object value)
Wrapper around the containsValue() method of the cache implementation.

Specified by:
containsValue in interface Map

entrySet

public Set entrySet()
Wrapper around the entrySet() method of the cache implementation.

Specified by:
entrySet in interface Map

equals

public boolean equals(Object o)
Wrapper around the equals() method of the cache implementation.

Specified by:
equals in interface Map

get

public Object get(Object key)
Wrapper around the get() method of the cache implementation.

Specified by:
get in interface Map

hashCode

public int hashCode()
Wrapper around the hashCode() method of the cache implementation.

Specified by:
hashCode in interface Map

isEmpty

public boolean isEmpty()
Wrapper around the isEmpty() method of the cache implementation.

Specified by:
isEmpty in interface Map

keySet

public Set keySet()
Wrapper around the keySet() method of the cache implementation.

Specified by:
keySet in interface Map

put

public Object put(Object key,
                  Object value)
Wrapper around the put() method of the cache implementation.

Specified by:
put in interface Map

putAll

public void putAll(Map t)
Wrapper around the putAll() method of the cache implementation.

Specified by:
putAll in interface Map

remove

public Object remove(Object key)
Wrapper around the remove() method of the cache implementation.

Specified by:
remove in interface Map

size

public int size()
Wrapper around the size() method of the cache implementation.

Specified by:
size in interface Map

values

public Collection values()
Wrapper around the values() method of the cache implementation.

Specified by:
values in interface Map

getByteSize

public int getByteSize()
See Also:
SizeMeasurable.getByteSize()

getByteSize

public int getByteSize(SizeOf sizeof)
See Also:
SizeMeasurable.getByteSize(org.mmbase.util.SizeOf)


MMBase build 1.8.1.20060716