|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.kernel.ComponentBase
com.jcorporate.expresso.core.cache.DefaultCacheManager
[Currently a placeholder. Will be expanded out soon]
| Constructor Summary | |
DefaultCacheManager()
|
|
| 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 |
checkMemory()
Checks to make sure that there is enough memory available to use for more caches. |
void |
clear()
Removes all cache items for a particular data context |
void |
clear(String cacheName)
Clear's the named cache. |
boolean |
clearLowestCache()
Removed the least used 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. |
void |
configure(Configuration newConfig)
Configure the service. |
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. |
Cache |
createCache(String cacheName,
boolean ordered,
int maxSize)
Creates a cache as specified by the parameters listed. |
void |
destroy()
Called upon destruction of the service. |
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 |
initialize()
Initialize the component, this is called before the component receives any configuration information. |
void |
put(String cacheName,
Cacheable newItem)
Adds a Cacheable item into the cache without clearing
related caches. |
void |
put(String cacheName,
Cacheable newItem,
long expiry)
Adds a Cacheable item into the cache without clearing
related caches. |
void |
reconfigure(Configuration newConfig)
Reconfigures the service during runtime without having to restart the container. |
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. |
| Methods inherited from class com.jcorporate.expresso.kernel.ComponentBase |
getMetaData, getMetadataLocation, getParent, setMetaData, setParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultCacheManager()
| Method Detail |
public Set getAllCacheNames()
getAllCacheNames in interface CacheSystem
public Cacheable getItem(String cacheName,
String valueKey)
getItem in interface CacheSystemcacheName - The name of the cachevalueKey - The particular item within the cache to get
public int getItemCount(String cacheName)
getItemCount in interface CacheSystemcacheName - The name of the cache
public void setItems(String cacheName,
List itemList)
throws CacheException
setItems in interface CacheSystemcacheName - 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
setItems in interface CacheSystemcacheName - 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)
getItems in interface CacheSystemcacheName - The name of the cache to retrieve
public void addItem(String cacheName,
Cacheable newItem)
throws CacheException
Cacheable item into the cache
addItem in interface CacheSystemcacheName - 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
addItem in interface CacheSystemcacheName - 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 put(String cacheName,
Cacheable newItem)
throws CacheException
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.
put in interface CacheSystemcacheName - the name of the cache to add tonewItem - the item to add
CacheException - upon error putting the item into the cache
public void put(String cacheName,
Cacheable newItem,
long expiry)
throws CacheException
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.
put in interface CacheSystemcacheName - the name of the cache to add tonewItem - the item to addexpiry - The time in miliseconds that this cache item will expire
CacheException - upon error putting the item into the cache
public void addListener(String listener,
String listenTo)
addListener in interface CacheSystemlistener - The classname of the listenerlistenTo - The name of the cache to listen to.public void adjustForMemory()
adjustForMemory in interface CacheSystem
public void clear(String cacheName)
throws CacheException
clear in interface CacheSystemcacheName - The name of the cache to clear
CacheException - if there's an error clearing the cache.
public void clear()
throws CacheException
clear in interface CacheSystemCacheException - CacheException if there's an error clearing the
cachepublic void clearNoNotify()
clearNoNotify in interface CacheSystempublic void clearNoNotify(String cacheName)
clearNoNotify in interface CacheSystemcacheName - The name of the cache
public Cache createCache(String cacheName,
boolean ordered,
int maxSize)
throws CacheException
createCache in interface CacheSystemcacheName - java.lang.String the name of the cacheordered - boolean true if you want an ordered cache such as for
ValidValuesmaxSize - the maximum size of the cache (zero if boundless)
CacheException
public Cache createCache(String cacheName,
boolean ordered)
throws CacheException
createCache in interface CacheSystemcacheName - java.lang.String The name of the cacheordered - boolean True if you wish for an ordered cache.
CacheExceptionpublic boolean existsCache(String cacheName)
existsCache in interface CacheSystemcacheName - The name of the cache
public Cache getCache(String cacheName)
getCache in interface CacheSystemcacheName - the name of the cache to retrieve.
Cache
public void removeItem(String cacheName,
Cacheable itemToRemove)
throws CacheException
removeItem in interface CacheSystemcacheName - The name of the cacheitemToRemove - the key of the item to remove
CacheException
public void removeItemNoNotify(String cacheName,
Cacheable itemToRemove)
throws CacheException
removeItemNoNotify in interface CacheSystemcacheName - The cache nameitemToRemove - the key in the cache that has been modified
CacheException - Upon error removing the item from the cachepublic void initialize()
ComponentLifecycle
initialize in interface ComponentLifecycle
public void configure(Configuration newConfig)
throws ConfigurationException
ComponentLifecycle
configure in interface ComponentLifecyclenewConfig - a read only dynabean containing all the needed configuration.
ConfigurationException - if for some reason the Component cannot cope
with the configuration sent to it. If this exception is thrown then ZERO
reconfiguration takes place. Configure() must be an all or nothing 'transaction'
public void reconfigure(Configuration newConfig)
throws ConfigurationException
ComponentLifecycleReconfigures the service during runtime without having to restart the container.
Reconfigure is done this way vs. bean/property setters because sometimes components need special property setting orders and it is not easily possible to determine what order to set things in. This is the responsibility of the component
reConfigure() should be done in a transactional manner.... by that, we mean that if the reconfiguration fails, the component should revert to its previous state and continue operation
reconfigure in interface ComponentLifecyclenewConfig - a read only dynabean containing all the needed configuration.
ConfigurationException - if for some reason the Component cannot cope
with the configuration sent to it. If this exception is thrown then ZERO
reconfiguration takes place. Configure() must be an all or nothing 'transaction'public void destroy()
ComponentLifecycle
destroy in interface ComponentLifecyclepublic void checkMemory()
public boolean clearLowestCache()
public void displayStatus()
displayStatus in interface CacheSystem
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||