|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.vignette.portal.cache.CacheStrategy
|
+--com.vignette.portal.cache.ActionBasedCacheStrategy
|
+--com.vignette.portal.cache.SizeBasedStrategy
|
+--com.vignette.portal.cache.FirstInFirstOutStrategy
|
+--com.vignette.portal.cache.HardFirstInFirstOutStrategy
Makes sure the size threshold is never exceeded.
This strategy checks the size boundary every time something is added to the cache and therefore has high everhead. In addition, by aggressively removing contents from the cache, it lowers the hit ratio and may trigger more database accesses than a less aggressive strategy.
SoftFirstInFirstOutStrategy| Constructor Summary | |
HardFirstInFirstOutStrategy(CacheAction action,
int sizeOfCache)
Creates a cache of specified size with specified action logic. |
|
HardFirstInFirstOutStrategy(int sizeOfCache)
Creates a cache of specified size with default action logic. |
|
| Method Summary | |
void |
onPut(Object key,
Object value,
Map properties)
Someone wants to add the pair key / value
to the cache. |
void |
onPutAll(Map keyValuePairs,
Map properties)
Someone wants to add the pairs in keyValuePairs to the
cache. |
| Methods inherited from class com.vignette.portal.cache.FirstInFirstOutStrategy |
onAdd, onGet |
| Methods inherited from class com.vignette.portal.cache.SizeBasedStrategy |
getSizeOfCache, onInvalidate, onInvalidateAll, onInvalidateAll, onRemove, onRemoveAll, onRemoveAll |
| Methods inherited from class com.vignette.portal.cache.ActionBasedCacheStrategy |
getCacheAction, setStore |
| Methods inherited from class com.vignette.portal.cache.CacheStrategy |
getStore, onAddAll, onGetAll |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HardFirstInFirstOutStrategy(int sizeOfCache)
Creates a cache of specified size with default action logic.
sizeOfCache - the maximum number of objects allowed in the cache.FirstInFirstOutStrategy.FirstInFirstOutStrategy(int)
public HardFirstInFirstOutStrategy(CacheAction action,
int sizeOfCache)
Creates a cache of specified size with specified action logic.
action - the non-null action to invoke when the size of the cache is exceeded.sizeOfCache - the maximum number of objects allowed in the cache.FirstInFirstOutStrategy.FirstInFirstOutStrategy(CacheAction, int)| Method Detail |
public void onPut(Object key,
Object value,
Map properties)
throws CacheException
CacheStrategySomeone wants to add the pair key / value
to the cache. This strategy can reject the operation by throwing an
exception. The actual addition, if allowed, will be signalled later by
a call to this strategy's onAdd method.
Individual strategies can use the information in
properties to override their creation-time parameters.
onPut in class CacheStrategycom.vignette.portal.cache.CacheStrategykey - key being addedvalue - value being added, matching keyproperties - possible overrides, can be null
public void onPutAll(Map keyValuePairs,
Map properties)
throws CacheException
CacheStrategySomeone wants to add the pairs in keyValuePairs to the
cache. This strategy can reject the operation by throwing an
exception. The actual addition, if allowed, will be signalled later
by a call to this strategy's onAddAll method.
Individual strategies can use the information in
properties to override their creation-time parameters.
This is a default implementation. For performance purposes you may wish to override it. If you do, you should not be calling super.onPutAll(Map, Map).
onPutAll in class CacheStrategycom.vignette.portal.cache.CacheStrategykeyValuePairs - key/value pairs being addedproperties - possible overrides, can be null
|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||