org.castor.cache
Class DebuggingCacheProxy

java.lang.Object
  extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
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<java.util.Map.Entry<java.lang.Object,java.lang.Object>> 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.
 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<java.lang.Object> keySet()
          
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          
 void putAll(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> map)
          
 java.lang.Object remove(java.lang.Object key)
          
 int size()
          
 java.util.Collection<java.lang.Object> 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.

close

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

Specified by:
close in interface Cache

getType

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

Specified by:
getType in interface Cache
Returns:
The cache type.

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.

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.

expireAll

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

Specified by:
expireAll in interface Cache

size

public int size()

Specified by:
size in interface java.util.Map<java.lang.Object,java.lang.Object>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface java.util.Map<java.lang.Object,java.lang.Object>

containsKey

public boolean containsKey(java.lang.Object key)

Specified by:
containsKey in interface java.util.Map<java.lang.Object,java.lang.Object>

containsValue

public boolean containsValue(java.lang.Object value)

Specified by:
containsValue in interface java.util.Map<java.lang.Object,java.lang.Object>

get

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

Specified by:
get in interface java.util.Map<java.lang.Object,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<java.lang.Object,java.lang.Object>

remove

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

Specified by:
remove in interface java.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:
putAll in interface java.util.Map<java.lang.Object,java.lang.Object>

clear

public void clear()

Specified by:
clear in interface java.util.Map<java.lang.Object,java.lang.Object>

keySet

public java.util.Set<java.lang.Object> keySet()

Specified by:
keySet in interface java.util.Map<java.lang.Object,java.lang.Object>

values

public java.util.Collection<java.lang.Object> values()

Specified by:
values in interface java.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:
entrySet in interface java.util.Map<java.lang.Object,java.lang.Object>


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com