| java.lang.Object com.jcorporate.expresso.kernel.ComponentBase com.jcorporate.expresso.core.cache.DefaultCacheManager
Method Summary | |
public void | addItem(String cacheName, Cacheable newItem) | public void | addItem(String cacheName, Cacheable newItem, long expiry) | public void | addListener(String listener, String listenTo) Specify a relationship between caches. | public void | adjustForMemory() Instructs the cache system to adjust it's usage profile based upon
current memory information that the expresso system is telling us. | public void | checkMemory()
Checks to make sure that there is enough memory available to use for more
caches. | public void | clear(String cacheName) Clear's the named cache. | public void | clear() | public boolean | clearLowestCache() | public void | clearNoNotify() | public void | clearNoNotify(String cacheName) Clear the named cache, but don't send the remote system notifications. | public void | configure(Configuration newConfig) | public Cache | createCache(String cacheName, boolean ordered, int maxSize) Creates a cache as specified by the parameters listed. | public Cache | createCache(String cacheName, boolean ordered) Creates a cache defined by whether the cache is to be ordered, it's name
and it's maximum size. | public void | destroy() | public void | displayStatus() Displays the cache status. | public boolean | existsCache(String cacheName) Checks to see if the cache already exists. | public java.util.Set | getAllCacheNames() | public Cache | getCache(String cacheName) Retrieve a given cache by name.
Parameters: cacheName - the name of the cache to retrieve. | public Cacheable | getItem(String cacheName, String valueKey) | public int | getItemCount(String cacheName) Return a count of the number of items in a cache. | public java.util.List | getItems(String cacheName) Return all of the items in a cache. | public void | initialize() | public void | put(String cacheName, Cacheable newItem) Adds a Cacheable item into the cache without clearing
related caches. | public void | put(String cacheName, Cacheable newItem, long expiry) Adds a Cacheable item into the cache without clearing
related caches. | public void | reconfigure(Configuration newConfig) | public void | removeItem(String cacheName, Cacheable itemToRemove) | public void | removeItemNoNotify(String cacheName, Cacheable itemToRemove) | public void | setItems(String cacheName, java.util.List itemList) Sets a cache to have the particular items specified in itemList. | public void | setItems(String cacheName, java.util.List itemList, long expiration) Sets a cache to have the particular items specified in itemList. |
DefaultCacheManager | public DefaultCacheManager()(Code) | | |
addItem | public void addItem(String cacheName, Cacheable newItem) throws CacheException(Code) | | Adds a Cacheable item into the cache
Parameters: cacheName - The name of the cache. Parameters: newItem - The new item to add to the cache throws: CacheException - upon error inserting into the system |
addItem | public void addItem(String cacheName, Cacheable newItem, long expiry) throws CacheException(Code) | | Adds an item to the cache named by parameter cacheName
Parameters: cacheName - The name of the cache to store the object in Parameters: newItem - The new item to add to the cache Parameters: expiry - The time in miliseconds that this cache item will expire throws: CacheException - if there's an error inserting the item into thecache |
addListener | public void addListener(String listener, String listenTo)(Code) | | Specify a relationship between caches. Whenever an add clear or remove
event is sent to the specified cache, the listener is cleared as well.
Adding a listener implies the relationship between the caches for the
current
db context.
Parameters: listener - The classname of the listener Parameters: listenTo - The name of the cache to listen to. |
adjustForMemory | public void adjustForMemory()(Code) | | Instructs the cache system to adjust it's usage profile based upon
current memory information that the expresso system is telling us.
|
checkMemory | public void checkMemory()(Code) | |
Checks to make sure that there is enough memory available to use for more
caches. If it there isn't enough free memory, then it attempts to clear
out the least used cache.
Creation date: (9/7/00 2:44:05 PM)
|
clear | public void clear(String cacheName) throws CacheException(Code) | | Clear's the named cache.
Parameters: cacheName - The name of the cache to clear throws: CacheException - if there's an error clearing the cache. |
clear | public void clear() throws CacheException(Code) | | Removes all cache items for a particular data context
throws: CacheException - CacheException if there's an error clearing thecache |
clearLowestCache | public boolean clearLowestCache()(Code) | | Removed the least used Cache
true if something was able to be removed; false otherwise |
clearNoNotify | public void clearNoNotify()(Code) | | Clears all caches in this db context but doesn't notify any listeners
|
clearNoNotify | public void clearNoNotify(String cacheName)(Code) | | Clear the named cache, but don't send the remote system notifications.
This method actually removes the cache from the list of available
caches
Parameters: cacheName - The name of the cache |
createCache | public Cache createCache(String cacheName, boolean ordered, int maxSize) throws CacheException(Code) | | Creates a cache as specified by the parameters listed. Creation date:
(9/7/00 2:18:09 PM)
Parameters: cacheName - java.lang.String the name of the cache Parameters: ordered - boolean true if you want an ordered cache such as forValidValues Parameters: maxSize - the maximum size of the cache (zero if boundless) the newly instantiated Cache |
createCache | public Cache createCache(String cacheName, boolean ordered) throws CacheException(Code) | | Creates a cache defined by whether the cache is to be ordered, it's name
and it's maximum size. Creation date: (9/7/00 2:18:09 PM)
Parameters: cacheName - java.lang.String The name of the cache Parameters: ordered - boolean True if you wish for an ordered cache. the newly instantiated cache |
destroy | public void destroy()(Code) | | |
displayStatus | public void displayStatus()(Code) | | Displays the cache status. Currently this is only really used for
debugging purposes.
Creation date: (9/7/00 2:44:05 PM)
|
existsCache | public boolean existsCache(String cacheName)(Code) | | Checks to see if the cache already exists. One big note about this is
that unless you already have a ReadLock, the cache may or may not exist
once you go to put your data in the cache. Buyer beware.
Parameters: cacheName - The name of the cache true if the named cache already exists in this data context |
getAllCacheNames | public java.util.Set getAllCacheNames()(Code) | | Return an iterator over a list of Strings that contain all the names of
the caches stored in the system [For dbContext default]
java.util.Iterator |
getItem | public Cacheable getItem(String cacheName, String valueKey)(Code) | | Get a particular item in the cache
Parameters: cacheName - The name of the cache Parameters: valueKey - The particular item within the cache to get a Cacheable object or null if it doesn't exist in the cache |
getItemCount | public int getItemCount(String cacheName)(Code) | | Return a count of the number of items in a cache. Return 0 if there is
no such item
Parameters: cacheName - The name of the cache an item count or zero if the cache doesn't exist or is empty; |
getItems | public java.util.List getItems(String cacheName)(Code) | | Return all of the items in a cache. If the cache was created as an
ordered cache, the items will be in the order they were added. If not,
they will be in no particular order. If there is no such cache or no
items, null will be returned.
Parameters: cacheName - The name of the cache to retrieve java.util.List of Cacheable items |
initialize | public void initialize()(Code) | | |
put | public void put(String cacheName, Cacheable newItem) throws CacheException(Code) | | Adds a Cacheable item into the cache without clearing
related caches. This is to differentiate between 'changed' items that
are added to the cache via addItem that would require related
caches to be cleared to maintain data integrity.
Parameters: cacheName - the name of the cache to add to Parameters: newItem - the item to add throws: CacheException - upon error putting the item into the cache |
put | public void put(String cacheName, Cacheable newItem, long expiry) throws CacheException(Code) | | Adds a Cacheable item into the cache without clearing
related caches. This is to differentiate between 'changed' items that
are added to the cache via addItem that would require related
caches to be cleared to maintain data integrity.
Parameters: cacheName - the name of the cache to add to Parameters: newItem - the item to add Parameters: expiry - The time in miliseconds that this cache item will expire throws: CacheException - upon error putting the item into the cache |
removeItem | public void removeItem(String cacheName, Cacheable itemToRemove) throws CacheException(Code) | | Removes an item from the cache
Parameters: cacheName - The name of the cache Parameters: itemToRemove - the key of the item to remove |
removeItemNoNotify | public void removeItemNoNotify(String cacheName, Cacheable itemToRemove) throws CacheException(Code) | | Removes an item out of the cache without notifying the cache listeners
Parameters: cacheName - The cache name Parameters: itemToRemove - the key in the cache that has been modified throws: CacheException - Upon error removing the item from the cache |
setItems | public void setItems(String cacheName, java.util.List itemList) throws CacheException(Code) | | Sets a cache to have the particular items specified in itemList.
Parameters: cacheName - The name of the cache Parameters: itemList - The items to set into the cache throws: CacheException - if there's an error setting the items. |
setItems | public void setItems(String cacheName, java.util.List itemList, long expiration) throws CacheException(Code) | | Sets a cache to have the particular items specified in itemList.
Parameters: cacheName - The name of the cache Parameters: itemList - The items to set into the cache Parameters: expiration - the expiration time in milliseconds for the items. throws: CacheException - if there's an error setting the items. |
|
|