solar.module.cache
Interface Cache

All Known Implementing Classes:
BaseCache

public interface Cache

Interface for a cache.

Version:
$Id: Cache.java,v 1.1 2003/10/04 01:49:26 glchen Exp $
Author:
Guanling Chen

Nested Class Summary
static interface Cache.CacheListener
          Interface for receiving cache events.
 
Method Summary
 void addListener(Cache.CacheListener lis)
          Add a listener to the cache.
 void addObject(java.lang.Object objectId, java.lang.Object obj)
          Put an object into the cache.
 void flush()
          Flush all the objects in the cache.
 CachedObject getCachedObject(java.lang.Object objectId)
          Get the container for an object from the cache.
 java.util.List getCachedObjects()
          Get the list of the cached objects from the cache.
 int getCapacity()
          Get the capacity of the cache.
 java.lang.Object getObject(java.lang.Object objectId)
          Get an object from the cache.
 java.util.List getObjectIds()
          Get the list of the object ids from the cache.
 java.util.List getObjects()
          Get the list of the objects from the cache.
 int getSize()
          Get the number of objects in the cache.
 void removeListener(Cache.CacheListener lis)
          Remove a listener from the cache.
 void removeObject(java.lang.Object objectId)
          Remove an object from a cache.
 

Method Detail

addListener

public void addListener(Cache.CacheListener lis)
Add a listener to the cache.


removeListener

public void removeListener(Cache.CacheListener lis)
Remove a listener from the cache.


addObject

public void addObject(java.lang.Object objectId,
                      java.lang.Object obj)
               throws CacheException
Put an object into the cache.

CacheException

getObject

public java.lang.Object getObject(java.lang.Object objectId)
Get an object from the cache.


getCachedObject

public CachedObject getCachedObject(java.lang.Object objectId)
Get the container for an object from the cache.


getObjects

public java.util.List getObjects()
Get the list of the objects from the cache.


getCachedObjects

public java.util.List getCachedObjects()
Get the list of the cached objects from the cache.


getObjectIds

public java.util.List getObjectIds()
Get the list of the object ids from the cache.


removeObject

public void removeObject(java.lang.Object objectId)
Remove an object from a cache.


getCapacity

public int getCapacity()
Get the capacity of the cache.


getSize

public int getSize()
Get the number of objects in the cache.


flush

public void flush()
Flush all the objects in the cache.