Package org.castor.cache
Class DebuggingCacheProxy
- java.lang.Object
-
- org.castor.cache.DebuggingCacheProxy
-
- All Implemented Interfaces:
java.util.Map<java.lang.Object,java.lang.Object>,Cache
public final class DebuggingCacheProxy extends java.lang.Object implements Cache
A debugging cache proxy.- Since:
- 1.0
- Version:
- $Revision: 8102 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Ralf Joachim
-
-
Field Summary
-
Fields inherited from interface org.castor.cache.Cache
DEFAULT_DEBUG, DEFAULT_NAME, DEFAULT_TYPE, PARAM_DEBUG, PARAM_NAME, PARAM_TYPE
-
-
Constructor Summary
Constructors Constructor Description DebuggingCacheProxy(Cache cache)Construct a DebugCacheProxy for given cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidclose()Life-cycle method to allow custom resource cleanup for a cache implementation.booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>>entrySet()voidexpire(java.lang.Object key)Remove the mapping identified by key from the cache.voidexpireAll()Removes all mappings from the cache.java.lang.Objectget(java.lang.Object key)java.lang.StringgetName()Get virtual name of this cache.java.lang.StringgetType()Indicates the type of this cache.voidinitialize(java.util.Properties params)Lyfe-cycle method to allow custom initialization of cache implementations.booleanisEmpty()java.util.Set<java.lang.Object>keySet()java.lang.Objectput(java.lang.Object key, java.lang.Object value)voidputAll(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> map)java.lang.Objectremove(java.lang.Object key)intsize()java.util.Collection<java.lang.Object>values()
-
-
-
Constructor Detail
-
DebuggingCacheProxy
public DebuggingCacheProxy(Cache cache)
Construct a DebugCacheProxy for given cache.- Parameters:
cache- The wrapped cache.
-
-
Method Detail
-
initialize
public void initialize(java.util.Properties params) throws CacheAcquireExceptionLyfe-cycle method to allow custom initialization of cache implementations.- Specified by:
initializein interfaceCache- Parameters:
params- Parameters to initialize the cache (e.g. name, capacity).- Throws:
CacheAcquireException- If cache can not be initialized.
-
close
public void close()
Life-cycle method to allow custom resource cleanup for a cache implementation.
-
getType
public java.lang.String getType()
Indicates the type of this cache.
-
getName
public java.lang.String getName()
Get virtual name of this cache. Castor sets the cache name to the class name of the objects stored in the cache.
-
expire
public void expire(java.lang.Object key)
Remove the mapping identified by key from the cache.
-
expireAll
public void expireAll()
Removes all mappings from the cache.
-
size
public int size()
- Specified by:
sizein interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKeyin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValuein interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
getin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)- Specified by:
putin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
putAll
public void putAll(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> map)
- Specified by:
putAllin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
keySet
public java.util.Set<java.lang.Object> keySet()
- Specified by:
keySetin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
valuesin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet()
- Specified by:
entrySetin interfacejava.util.Map<java.lang.Object,java.lang.Object>
-
-