org.castor.cache
Class DebuggingCacheProxy

java.lang.Object
  extended byorg.castor.cache.DebuggingCacheProxy
All Implemented Interfaces:
Cache, java.util.Map

public final class DebuggingCacheProxy
extends java.lang.Object
implements Cache

A debugging cache proxy.

Since:
1.0
Version:
$Revision: 6907 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
Author:
Ralf Joachim

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
 
Fields inherited from interface org.castor.cache.Cache
DEFAULT_DEBUG, DEFAULT_NAME, DEFAULT_TYPE, PARAM_DEBUG, PARAM_NAME, PARAM_TYPE
 
Constructor Summary
DebuggingCacheProxy(Cache cache)
          Construct a DebugCacheProxy for given cache.
 
Method Summary
 void clear()
          
 void close()
          Life-cycle method to allow custom resource cleanup for a cache implementation.
 boolean containsKey(java.lang.Object key)
          
 boolean containsValue(java.lang.Object value)
          
 java.util.Set entrySet()
          
 void expire(java.lang.Object key)
          Remove the mapping identified by key from the cache.
 void expireAll()
          Removes all mappings from the cache.
 java.lang.Object get(java.lang.Object key)
          
 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.
 java.lang.String getType()
          Indicates the type of this cache.
 void initialize(java.util.Properties params)
          Lyfe-cycle method to allow custom initialization of cache implementations.
 boolean isEmpty()
          
 java.util.Set keySet()
          
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          
 void putAll(java.util.Map map)
          
 java.lang.Object remove(java.lang.Object key)
          
 int size()
          
 java.util.Collection values()
          
 
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
 

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 CacheAcquireException
Lyfe-cycle method to allow custom initialization of cache implementations.

Specified by:
initialize in interface Cache
Parameters:
params - Parameters to initialize the cache (e.g. name, capacity).
Throws:
CacheAcquireException - If cache can not be initialized.
See Also:
Cache.initialize(java.util.Properties)

close

public void close()
Life-cycle method to allow custom resource cleanup for a cache implementation.

Specified by:
close in interface Cache
See Also:
Cache.close()

getType

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

Specified by:
getType in interface Cache
Returns:
The cache type.
See Also:
Cache.getType()

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.

Specified by:
getName in interface Cache
Returns:
The cache name.
See Also:
Cache.getName()

expire

public void expire(java.lang.Object key)
Remove the mapping identified by key from the cache.

Specified by:
expire in interface Cache
Parameters:
key - the key that needs to be removed.
See Also:
Cache.expire(java.lang.Object)

expireAll

public void expireAll()
Removes all mappings from the cache.

Specified by:
expireAll in interface Cache
See Also:
Cache.expireAll()

size

public int size()

Specified by:
size in interface java.util.Map
See Also:
Map.size()

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface java.util.Map
See Also:
Map.isEmpty()

containsKey

public boolean containsKey(java.lang.Object key)

Specified by:
containsKey in interface java.util.Map
See Also:
Map.containsKey(java.lang.Object)

containsValue

public boolean containsValue(java.lang.Object value)

Specified by:
containsValue in interface java.util.Map
See Also:
Map.containsValue(java.lang.Object)

get

public java.lang.Object get(java.lang.Object key)

Specified by:
get in interface java.util.Map
See Also:
Map.get(java.lang.Object)

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)

Specified by:
put in interface java.util.Map
See Also:
Map.put(java.lang.Object, java.lang.Object)

remove

public java.lang.Object remove(java.lang.Object key)

Specified by:
remove in interface java.util.Map
See Also:
Map.remove(java.lang.Object)

putAll

public void putAll(java.util.Map map)

Specified by:
putAll in interface java.util.Map
See Also:
Map.putAll(java.util.Map)

clear

public void clear()

Specified by:
clear in interface java.util.Map
See Also:
Map.clear()

keySet

public java.util.Set keySet()

Specified by:
keySet in interface java.util.Map
See Also:
Map.keySet()

values

public java.util.Collection values()

Specified by:
values in interface java.util.Map
See Also:
Map.values()

entrySet

public java.util.Set entrySet()

Specified by:
entrySet in interface java.util.Map
See Also:
Map.entrySet()


Copyright 2008 null. All Rights Reserved.