|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This is an interface for an underlying cache system. It allows clients of the itnerface to add items, retrieve items, and clear caches.
The CacheSystem is not data context aware. Classes that implement this interface are expected to be one instance per context. The Component System provides differentiation between caches.
| Method Summary | |
void |
addItem(String cacheName,
Cacheable newItem)
Adds a Cacheable item into the cache |
void |
addItem(String cacheName,
Cacheable newItem,
long expiry)
Adds an item to the cache named by parameter cacheName |
void |
addListener(String listener,
String listenTo)
Specify a relationship between caches. |
void |
adjustForMemory()
Instructs the cache system to adjust it's usage profile based upon current memory information that the expresso system is telling us. |
void |
clear()
Removes all cache items for a particular data context |
void |
clear(String cacheName)
Clear's the named cache. |
void |
clearNoNotify()
Clears all caches in this db context but doesn't notify any listeners |
void |
clearNoNotify(String cacheName)
Clear the named cache, but don't send the remote system notifications. |
Cache |
createCache(String cacheName,
boolean ordered)
Creates a cache as specified by the parameters listed. |
Cache |
createCache(String cacheName,
boolean ordered,
int maxSize)
Creates a cache defined by whether the cache is to be ordered, it's name and it's maximum size. |
void |
displayStatus()
Displays the cache status. |
boolean |
existsCache(String cacheName)
Checks to see if the cache already exists. |
Set |
getAllCacheNames()
Return an iterator over a list of Strings that contain all the names of the caches stored in the system [For dbContext default] |
Cache |
getCache(String cacheName)
Retrieve a given cache by name. |
Cacheable |
getItem(String cacheName,
String valueKey)
Get a particular item in the cache |
int |
getItemCount(String cacheName)
Return a count of the number of items in a cache. |
List |
getItems(String cacheName)
Return all of the items in a cache. |
void |
removeItem(String cacheName,
Cacheable itemToRemove)
Removes an item from the cache |
void |
removeItemNoNotify(String cacheName,
Cacheable itemToRemove)
Removes an item out of the cache without notifying the cache listeners |
void |
setItems(String cacheName,
List itemList)
Sets a cache to have the particular items specified in itemList. |
void |
setItems(String cacheName,
List itemList,
long expiration)
Sets a cache to have the particular items specified in itemList. |
| Method Detail |
public void adjustForMemory()
public Set getAllCacheNames()
public Cacheable getItem(String cacheName,
String valueKey)
cacheName - The name of the cachevalueKey - The particular item within the cache to get
public Cache getCache(String cacheName)
cacheName - the name of the cache to retrieve.
Cachepublic int getItemCount(String cacheName)
cacheName - The name of the cache
public void setItems(String cacheName,
List itemList)
throws CacheException
cacheName - The name of the cacheitemList - The items to set into the cache
CacheException - if there's an error setting the items.
public void setItems(String cacheName,
List itemList,
long expiration)
throws CacheException
cacheName - The name of the cacheitemList - The items to set into the cacheexpiration - the expiration time in milliseconds for the items.
CacheException - if there's an error setting the items.public List getItems(String cacheName)
cacheName - The name of the cache to retrieve
public void addItem(String cacheName,
Cacheable newItem)
throws CacheException
Cacheable item into the cache
cacheName - The name of the cache.newItem - The new item to add to the cache
CacheException - upon error inserting into the system
public void addItem(String cacheName,
Cacheable newItem,
long expiry)
throws CacheException
cacheName - The name of the cache to store the object innewItem - The new item to add to the cacheexpiry - The time in miliseconds that this cache item will expire
CacheException - if there's an error inserting the item into the
cache
public void addListener(String listener,
String listenTo)
listener - The classname of the listenerlistenTo - The name of the cache to listen to.
public void clear(String cacheName)
throws CacheException
cacheName - The name of the cache to clear
CacheException - if there's an error clearing the cache.
public void clear()
throws CacheException
CacheException - CacheException if there's an error clearing the
cachepublic void clearNoNotify()
public void clearNoNotify(String cacheName)
cacheName - The name of the cache
public Cache createCache(String cacheName,
boolean ordered)
throws CacheException
cacheName - java.lang.String the name of the cacheordered - boolean true if you want an ordered cache such as for
ValidValues
CacheException
public Cache createCache(String cacheName,
boolean ordered,
int maxSize)
throws CacheException
cacheName - java.lang.String The name of the cacheordered - boolean True if you wish for an ordered cache.maxSize - The maximum size of the cache
CacheExceptionpublic boolean existsCache(String cacheName)
cacheName - The name of the cache
public void removeItem(String cacheName,
Cacheable itemToRemove)
throws CacheException
cacheName - The name of the cacheitemToRemove - the key of the item to remove
CacheException
public void removeItemNoNotify(String cacheName,
Cacheable itemToRemove)
throws CacheException
cacheName - The cache nameitemToRemove - the key in the cache that has been modified
CacheException - Upon error removing the item from the cachepublic void displayStatus()
|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||