| 
 | Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Cache
This interface is the abstraction of something which provides a caching service. Implementations should take in parameters specific to the cache algorithm. Two implementations are provided, the LRUCache and GDSCache. This interface extends the Catalog interface, as the cache provides a Catalog service.
| Method Summary | |
|---|---|
|  void | cache(Id id,
      java.io.Serializable metadata,
      java.io.Serializable obj,
      Continuation c)Caches an object in this storage. | 
|  long | getMaximumSize()Returns the maximum size of the cache, in bytes. | 
|  void | setMaximumSize(int size,
               Continuation c)Sets the maximum size of the cache, in bytes. | 
|  void | uncache(Id id,
        Continuation c)Removes the object from the list of cached objects. | 
| Methods inherited from interface rice.persistence.Catalog | 
|---|
| exists, flush, getMetadata, getObject, getSize, getTotalSize, rename, scan, scan, scanMetadata, scanMetadata, scanMetadataValuesHead, scanMetadataValuesNull, setMetadata | 
| Method Detail | 
|---|
void cache(Id id,
           java.io.Serializable metadata,
           java.io.Serializable obj,
           Continuation c)
uncache(id) followed
 by cache(id, obj). This method finishes by calling
 receiveResult() on the provided continuation with whether or not
 the object was cached.  Note that the object may not actually be
 cached due to the cache replacement policy.
 Returns True if the cache actaully stores the object, else
 False (through receiveResult on c).
id - The object's id.metadata - The object's metdatadataobj - The object to cache.c - The command to run once the operation is complete
void uncache(Id id,
             Continuation c)
False is returned.
 Returns True if the action succeeds, else
 False  (through receiveResult on c).
pid - The object's idc - The command to run once the operation is completelong getMaximumSize()
c - The command to run once the operation is complete
void setMaximumSize(int size,
                    Continuation c)
size - The new maximum size, in bytes, of the cache.c - The command to run once the operation is complete| 
 | Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||