|
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.CacheAction
Is a pluggable operator for use in a CacheStrategy
to support different operations during the strategy's lifecycle.
Any subclass of the ActionBasedCacheStrategy takes an
instance of this class and invokes it at the appropriate points in its
lifecycle.
Any strategy provided by this API that extends ActionBasedCacheStrategy are guaranteed to function appropriately. Note that 3rd party strategies may not be up to date with the latest version of this class as more methods may be added in future versions of this API.
CacheStrategy,
ActionBasedCacheStrategy| Constructor Summary | |
CacheAction()
|
|
| Method Summary | |
protected Store |
getStore()
Accessor for the store. |
abstract void |
onAction(Object key)
This method is called when the CacheStrategy determines
that action is needed for key. |
abstract void |
onActions(Collection keys)
This method is called when the CacheStrategy determines
that action is needed for keys. |
void |
onAdd(Object key,
Object value,
Map properties)
Signals addition to the strategy. |
void |
onAddAll(Map keyValuePairs,
Map properties)
Signals addition to the strategy. |
void |
onGet(Object key,
Map properties)
Someone is accessing key in the CacheStrategy. |
void |
onGetAll(Collection keys,
Map properties)
Someone is accessing all the items mentioned in keys
in the CacheStrategy. |
void |
onRemove(Object key)
Signals removal from the strategy. |
void |
onRemoveAll()
Signals clearing of the strategy. |
void |
onRemoveAll(Collection keys)
Signals removal from the strategy. |
void |
setStore(Store store)
Called at cache creation time to tie the action to a cache's Store interface. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CacheAction()
| Method Detail |
public void setStore(Store store)
Called at cache creation time to tie the action to a cache's
Store interface. Can be called only once.
There should be no reason for non-framework code to ever call this method.
store - Special view of the cache to which this action belongsprotected final Store getStore()
Accessor for the store.
public abstract void onAction(Object key)
This method is called when the CacheStrategy determines
that action is needed for key.
Typical examples of this are when the key "expires"
or when the cache is full and needs to remove a value that has not
been used for a while.
key - the key for which action is neededpublic abstract void onActions(Collection keys)
This method is called when the CacheStrategy determines
that action is needed for keys.
Typical examples of this are when the keys "expire"
or when the cache is full and needs to remove values that have not
been used for a while.
keys - the collection of keys for which action is needed
public void onGet(Object key,
Map properties)
throws CacheException
Someone is accessing key in the CacheStrategy. This
will not be invoked for keys that the strategy is not monitoring.
Individual actions can use the information in
properties to override their creation-time parameters.
This implementation is a no-op.
key - item being looked upproperties - possible overrides, can be null
public void onGetAll(Collection keys,
Map properties)
throws CacheException
Someone is accessing all the items mentioned in keys
in the CacheStrategy. This will not be invoked for keys that
the strategy is not monitoring.
Individual actions can use the information in
properties to override their creation-time parameters.
This implementation is a no-op.
keys - items being looked upproperties - possible overrides, can be null
public void onAdd(Object key,
Object value,
Map properties)
Signals addition to the strategy. This event implies that its strategy
is monitoring key so the action should also monitor the key
if that is necessary for the action's function.
Individual actions can use the information in
properties to override their creation-time parameters.
This method should not throw any exception since it mirrors the function
of the CacheStrategy.onAdd(java.lang.Object, java.lang.Object, java.util.Map)
method.
This implementation is a no-op.
key - key being inserted in the cachevalue - value being inserted in the cache, matching keyproperties - possible overrides, can be null
public void onAddAll(Map keyValuePairs,
Map properties)
Signals addition to the strategy. This event implies that its strategy
is monitoring the mapping in keyValuePairs so the action should
also monitor the pairs if that is necessary for the action's function.
Individual actions can use the information in
properties to override their creation-time parameters.
This method should not throw any exception since it mirrors the function
of the CacheStrategy.onAddAll(java.util.Map, java.util.Map) method.
This implementation is a no-op.
keyValuePairs - key/value pairs being added to the cacheproperties - possible overrides, can be nullpublic void onRemove(Object key)
Signals removal from the strategy. This event implies that its strategy
has stopped monitoring key, so the action should also stop monitoring
key and clean up if necessary.
This method should not throw any exception since it mirrors the function
of the CacheStrategy.onRemove(java.lang.Object) method.
This implementation is a no-op.
key - key being removed from the strategypublic void onRemoveAll(Collection keys)
Signals removal from the strategy. This event implies that its strategy
has stopped monitoring all of keys, so the action should also
stop monitoring keys and clean up if necessary.
This method should not throw any exception since it mirrors the function
of the CacheStrategy.onRemoveAll(java.util.Collection) method.
This implementation is a no-op.
keys - keys being removed from the strategypublic void onRemoveAll()
Signals clearing of the strategy. This event implies that its strategy has stopped monitoring all keys, so the action should also stop monitoring all of the keys and clean up if necessary.
This method should not throw any exception since it mirrors the function
of the CacheStrategy.onRemoveAll() method.
This implementation is a no-op.
|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||