com.scooterframework.cache
Interface Cache

All Known Implementing Classes:
NamedCurrentThreadCache

public interface Cache

Cache interface defines methods of a cache store.


Method Summary
 void clear()
          Removes all key/value pairs from cache.
 java.lang.Object get(java.lang.Object key)
          Returns object from cache based on key.
 java.lang.Object getDelegateCache()
          Returns the underlying cache.
 java.util.Collection<java.lang.Object> getKeys()
          Returns keys in the cache
 java.lang.String getName()
          Returns the cache name.
 java.util.Properties getStatistics()
          Returns the Cache statistics.
 boolean put(java.lang.Object key, java.lang.Object value)
          Stores object into cache based on key.
 boolean remove(java.lang.Object key)
          Removes the mapping for this key from the cache if present.
 

Method Detail

getDelegateCache

java.lang.Object getDelegateCache()
Returns the underlying cache.

Returns:
the cache instance from vendor

getName

java.lang.String getName()
Returns the cache name.

Returns:
name of the cache

getKeys

java.util.Collection<java.lang.Object> getKeys()
Returns keys in the cache

Returns:
a collection of all keys

get

java.lang.Object get(java.lang.Object key)
Returns object from cache based on key.

Returns:
the value to which this cache maps the specified key, or null if the cache contains no mapping for this key.

put

boolean put(java.lang.Object key,
            java.lang.Object value)
Stores object into cache based on key.

Returns:
true if successful

remove

boolean remove(java.lang.Object key)
Removes the mapping for this key from the cache if present.

Returns:
true if successful

clear

void clear()
Removes all key/value pairs from cache.


getStatistics

java.util.Properties getStatistics()
Returns the Cache statistics.