|
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.SoftFirstInFirstOutStrategy
Periodically checks that the size threshold is not exceeded.
This strategy implements the Periodical interface and checks the
size boundary as part of its SoftFirstInFirstOutStrategy.onPeriod(long) method. Between periods, the
cache is allowed to grow in an unbounded fashion and gets trimmed at the
following periodical check. Its overhead is lower that some of the more
aggressive strategies, but it has a potential for overrunning the memory.
HardFirstInFirstOutStrategy| Constructor Summary | |
SoftFirstInFirstOutStrategy(CacheAction action,
int sizeOfCache)
Creates a cache of specified size with specified action logic. |
|
SoftFirstInFirstOutStrategy(int sizeOfCache)
Creates a cache of specified size with default action logic. |
|
| Method Summary | |
void |
onPeriod(long now)
|
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 SoftFirstInFirstOutStrategy(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 SoftFirstInFirstOutStrategy(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 nullpublic void onPeriod(long now)
onPeriod in interface Periodical
|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||