org.castor.cache.distributed
Class OsCache

java.lang.Object
  extended by org.castor.cache.AbstractBaseCache
      extended by org.castor.cache.distributed.OsCache
All Implemented Interfaces:
Map<Object,Object>, Cache

public final class OsCache
extends AbstractBaseCache

OSCache (opensymphony) implementation of Castor JDO Cache. For more details of OSCache, see http://www.opensymphony.com/oscache

Since:
1.0
Version:
$Revision: 8102 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
Author:
Werner Guttmann, Ralf Joachim
See Also:
The OSCache Home page

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static String IMPLEMENTATION
          The classname of the implementations cache class.
static String NEEDS_REFRESH_EXCEPTION
          Classname of exception thrown by getFromCache() method of oscache.
static String TYPE
          The type of the cache.
 
Fields inherited from interface org.castor.cache.Cache
DEFAULT_DEBUG, DEFAULT_NAME, DEFAULT_TYPE, PARAM_DEBUG, PARAM_NAME, PARAM_TYPE
 
Constructor Summary
OsCache(Object cache)
          Construct an instance of OsCache that wrapps access to given cache implementation of class com.opensymphony.oscache.general.GeneralCacheAdministrator.
 
Method Summary
 void clear()
          
 boolean containsKey(Object key)
          
 boolean containsValue(Object value)
          
 Set<Map.Entry<Object,Object>> entrySet()
          
 Object get(Object key)
          
 String getType()
          Indicates the type of this cache.
 void initialize(Properties params)
          Lyfe-cycle method to allow custom initialization of cache implementations.
 boolean isEmpty()
          
 Set<Object> keySet()
          
 Object put(Object key, Object value)
          
 void putAll(Map<? extends Object,? extends Object> map)
          
 Object remove(Object key)
          
 int size()
          
 Collection<Object> values()
          
 
Methods inherited from class org.castor.cache.AbstractBaseCache
close, expire, expireAll, getName, invokeMethod, invokeStaticMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

TYPE

public static final String TYPE
The type of the cache.

See Also:
Constant Field Values

IMPLEMENTATION

public static final String IMPLEMENTATION
The classname of the implementations cache class.

See Also:
Constant Field Values

NEEDS_REFRESH_EXCEPTION

public static final String NEEDS_REFRESH_EXCEPTION
Classname of exception thrown by getFromCache() method of oscache.

See Also:
Constant Field Values
Constructor Detail

OsCache

public OsCache(Object cache)
Construct an instance of OsCache that wrapps access to given cache implementation of class com.opensymphony.oscache.general.GeneralCacheAdministrator.

Parameters:
cache - The cache to be wrapped.
Method Detail

initialize

public void initialize(Properties params)
                throws CacheAcquireException
Lyfe-cycle method to allow custom initialization of cache implementations.

Specified by:
initialize in interface Cache
Overrides:
initialize in class AbstractBaseCache
Parameters:
params - Parameters to initialize the cache (e.g. name, capacity).
Throws:
CacheAcquireException - If cache can not be initialized.

getType

public String getType()
Indicates the type of this cache.

Returns:
The cache type.

size

public int size()


isEmpty

public boolean isEmpty()


containsKey

public boolean containsKey(Object key)


containsValue

public boolean containsValue(Object value)


get

public Object get(Object key)


put

public Object put(Object key,
                  Object value)


remove

public Object remove(Object key)


putAll

public void putAll(Map<? extends Object,? extends Object> map)


clear

public void clear()


keySet

public Set<Object> keySet()


values

public Collection<Object> values()


entrySet

public Set<Map.Entry<Object,Object>> entrySet()



Copyright © 2010. All Rights Reserved.