|
GigaSpaces XAP 10.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Deprecated public interface Cache
A cache, being a mechanism for efficient temporary storage of objects for the purpose of improving the overall performance of an application system.
A cache could be scoped, for examples to a JVM, all JVMs on a node, all nodes in a cluster, etc. Operations that are scoped to a cache such as put or load would affect all JVMs in the cache. So the object loaded in 1 JVM would be equally available to all other JVMs in the cache.
Objects are identified in the cache by a key. A key can be any Java object
that implements the uniquely the toString() method. If the object is to be
distributed or persisted (if supported) it must implement serializable.
Each object in the cache will have a CacheEntry object associated with it.
This object will encapsulate the metadata associated with the cached object.
All the methods that are inherited from Map might throw com.j_spaces.core.client.CacheException.
This Exception extends RuntimeException in order to keep the Map API.
CacheException,
CacheEntry| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
void |
addListener(CacheListener listener)
Deprecated. Add a listener to the list of cache listeners. |
void |
clear()
Deprecated. The clear method will remove all objects from the cache including the key and the associated value. |
boolean |
containsKey(Object key)
Deprecated. Returns true if the cache contains the specified key. |
boolean |
containsValue(Object value)
Deprecated. Returns true if this cache maps one or more keys to the specified value. |
Set |
entrySet()
Deprecated. Returns a set view of the objects currently contained in the cache. |
boolean |
equals(Object obj)
Deprecated. Equality is based on the Set returned by entrySet. |
boolean |
evict(Object key)
Deprecated. The evict method will remove object from the cache the matches the provided key. |
Object |
get(Object key)
Deprecated. The get method will return, from the cache, the object associated with the argument "key". |
Map |
getAll(Collection keys)
Deprecated. The getAll method will return, from the cache, a Map of the objects associated with the Collection of keys in argument "keys". |
CacheEntry |
getCacheEntry(Object key)
Deprecated. Returns the CacheEntry object associated with the object identified by "key". |
int |
hashCode()
Deprecated. Returns the hash code value for this cache. |
boolean |
isEmpty()
Deprecated. Return true if entrySet().isEmpty() return true. |
Set |
keySet()
Deprecated. Returns a set view of the keys currently contained in the cache. |
void |
load(Object key)
Deprecated. The load method provides a means to "pre load" the cache. |
void |
loadAll(Collection keys)
Deprecated. The loadAll method provides a means to "pre load" objects into the cache. |
Object |
peek(Object key)
Deprecated. The peek method will return the object associated with "key" if it currently exists (and is valid) in the cache. |
Object |
put(Object key,
Object value)
Deprecated. The put method adds the object "value" to the cache identified by the object "key". |
void |
putAll(Map map)
Deprecated. Copies all of the mappings from the specified map to the cache. |
Object |
remove(Object key)
Deprecated. The remove method will delete the object from the cache including the key, the associated value and the associated CacheStatistics object. |
void |
removeListener(CacheListener listener)
Deprecated. Remove a listener from the list of cache listeners. |
int |
size()
Deprecated. Returns the size of this map. |
Collection |
values()
Deprecated. Returns a collection view of the values contained in this cache. |
| Method Detail |
|---|
void addListener(CacheListener listener)
listener - call back CacheListener
UnsupportedOperationException - can be thrown by implementations that doesn't support this methodvoid clear()
clear in interface Mapboolean containsKey(Object key)
containsKey in interface Mapkey - key whose presence in this cache is to be tested.
true, if the cache contains the specified key.boolean containsValue(Object value)
containsValue in interface Mapvalue - value whose presence in this cache is to be tested.
true, if the cache contains the specified value.Set entrySet()
entrySet in interface Mapboolean equals(Object obj)
equals in interface Mapequals in class Objectobj - the Cache to check
true, if two caches returns the same entrySet().boolean evict(Object key)
key - the key to evict
true, if the key was evictedObject get(Object key)
get in interface Mapkey - key whose associated value is to be returned.
Map getAll(Collection keys)
throws CacheException
keys - keys whose associated values are to be returned.
CacheException - error accord while loadingCacheEntry getCacheEntry(Object key)
key - key whose associated value is to be returned.
int hashCode()
hashCode in interface MaphashCode in class Objectboolean isEmpty()
isEmpty in interface Maptrue if emptySet keySet()
keySet in interface Map
void load(Object key)
throws CacheException
key - key whose associated value is to be loaded.
CacheException - error accord while loading
void loadAll(Collection keys)
throws CacheException
keys - keys' Collection whose associated value to be loaded using the associated
CacheLoader if this cache doesn't contain it.
CacheException - error accord while loadingObject peek(Object key)
key - key whose associated value is to be peek.
Object put(Object key,
Object value)
put in interface Mapkey - key with which the specified value is to be associated.value - value to be associated with the specified key.
void putAll(Map map)
putAll in interface Mapmap - A map of key and values to be copy into the cacheObject remove(Object key)
remove in interface Mapkey - key whose associated value is to be removed.
void removeListener(CacheListener listener)
listener - the CacheListener to remove
UnsupportedOperationException - can be thrown by implementations that doesn't support this methodint size()
size in interface MapCollection values()
values in interface Map
|
GigaSpaces XAP 10.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||