net.sf.swarmcache
Class MultiCache

java.lang.Object
  |
  +--net.sf.swarmcache.MultiCache
All Implemented Interfaces:
ObjectCache

public class MultiCache
extends java.lang.Object
implements ObjectCache

A wrapper cache type that notifies the multicast cache manager.

Author:
John Watkinson

Field Summary
static java.lang.String CACHE_TYPE_PROPERTY
          The property holding the type of the underlying cache to use.
 
Constructor Summary
MultiCache(ObjectCache cache, MultiCacheManager manager)
           
 
Method Summary
 java.lang.Object clear(java.io.Serializable key)
          In this implementation, the clear is multicast to all caches.
 void clearAll()
          Clears the entire cache.
 void doClear(java.io.Serializable key)
          Here the clear is actually done.
 void doClearAll()
           
 java.lang.Object get(java.io.Serializable key)
          Gets an object from the cache by key, or returns null if that object is not cached.
 java.lang.String getType()
          Gets the common name of the type of objects to cache.
 void put(java.io.Serializable key, java.lang.Object object)
          Adds an object to the cache.
 void setType(java.lang.String type)
          Sets the common name of the type of objects to cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_TYPE_PROPERTY

public static final java.lang.String CACHE_TYPE_PROPERTY
The property holding the type of the underlying cache to use.

See Also:
Constant Field Values
Constructor Detail

MultiCache

public MultiCache(ObjectCache cache,
                  MultiCacheManager manager)
Method Detail

getType

public java.lang.String getType()
Description copied from interface: ObjectCache
Gets the common name of the type of objects to cache.

Specified by:
getType in interface ObjectCache

setType

public void setType(java.lang.String type)
Description copied from interface: ObjectCache
Sets the common name of the type of objects to cache.

Specified by:
setType in interface ObjectCache

put

public void put(java.io.Serializable key,
                java.lang.Object object)
Description copied from interface: ObjectCache
Adds an object to the cache.

Specified by:
put in interface ObjectCache

get

public java.lang.Object get(java.io.Serializable key)
Description copied from interface: ObjectCache
Gets an object from the cache by key, or returns null if that object is not cached.

Specified by:
get in interface ObjectCache

clear

public java.lang.Object clear(java.io.Serializable key)
In this implementation, the clear is multicast to all caches.

Specified by:
clear in interface ObjectCache

doClear

public void doClear(java.io.Serializable key)
Here the clear is actually done.


clearAll

public void clearAll()
Description copied from interface: ObjectCache
Clears the entire cache.

Specified by:
clearAll in interface ObjectCache

doClearAll

public void doClearAll()