|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface specification for performance caches as used in Castor. Please implement this interface if you wish to provide your own cache implementation.
| Method Summary | |
void |
clear()
Removes all mappings from this map. |
void |
close()
Life-cycle method to allow custom resource cleanup for a cache implementation |
boolean |
contains(java.lang.Object key)
Indicates whether the cache holds value object mapped to the specified key. |
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key |
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value. |
java.util.Enumeration |
elements()
Returns an enumeration of the values in this LRU map. |
java.util.Set |
entrySet()
Returns a set view of the keys contained in this map. |
void |
expire(java.lang.Object key)
Remove the object identified by key from the cache. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this hashtable. |
java.lang.String |
getCacheType()
Indicates the type of this cache. |
int |
getCapacity()
Indicates the cache capacity. |
java.lang.String |
getClassName()
Indicates the class name of objects stored in this cache. |
void |
initialize()
Lyfe-cycle method to allow custom initialization of cache implementations |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
java.util.Set |
keySet()
Returns a collection view of the values contained in this map. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Maps the specified key to the specified value
in this hashtable. |
void |
putAll(java.util.Map aMap)
Copies all of the mappings from the specified map to this map (optional operation). |
java.lang.Object |
remove(java.lang.Object key)
Removes the key (and its corresponding value) from this hashtable. |
void |
setCacheType(java.lang.String cacheType)
Sets the type of this cache instance. |
void |
setCapacity(int capacity)
Sets the cache capacity. |
void |
setClassName(java.lang.String className)
Sets the class name of objects cached here. |
int |
size()
Returns the number of key-value mappings in this map. |
java.util.Collection |
values()
|
| Method Detail |
public void initialize()
throws CacheAcquireException
CacheAcquireExceptionpublic void close()
public java.lang.Object get(java.lang.Object key)
key - - a key in the hashtable.
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
key to the specified value
in this hashtable. Neither the key nor the value can be null.
The value can be retrieved by calling the get method with
a key that is equal to the original key, before it is diposed by the
least-recently-used map.
key - the hashtable key.value - the value.
null if it did not have one.
java.lang.NullPointerException - if the key or value is null.public java.lang.Object remove(java.lang.Object key)
key - the key that needs to be removed.
null if the key did not have a mapping.public java.util.Enumeration elements()
Enumerationpublic void expire(java.lang.Object key)
key - the key that needs to be removed.public boolean contains(java.lang.Object key)
key - A key identifying a value object.
public java.lang.String getCacheType()
public void setCacheType(java.lang.String cacheType)
cacheType - The type of this cache.public int getCapacity()
public void setCapacity(int capacity)
capacity - the cache capacity.public java.lang.String getClassName()
public void setClassName(java.lang.String className)
className - The class name.
public int size()
throws MethodNotImplementedException
MethodNotImplementedException
public void clear()
throws MethodNotImplementedException
MethodNotImplementedException
public boolean isEmpty()
throws MethodNotImplementedException
MethodNotImplementedException
public boolean containsKey(java.lang.Object key)
throws MethodNotImplementedException
key - A key object.
MethodNotImplementedException
public boolean containsValue(java.lang.Object value)
throws MethodNotImplementedException
value - The object value.
MethodNotImplementedException
public java.util.Collection values()
throws MethodNotImplementedException
MethodNotImplementedExceptionpublic void putAll(java.util.Map aMap)
aMap - The map to be copied.
public java.util.Set entrySet()
throws MethodNotImplementedException
MethodNotImplementedException
public java.util.Set keySet()
throws MethodNotImplementedException
MethodNotImplementedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||