02/28/2005
 

com.vignette.portal.cache
Class PassivatingCacheAction

java.lang.Object
  |
  +--com.vignette.portal.cache.CacheAction
        |
        +--com.vignette.portal.cache.PassivatingCacheAction

public class PassivatingCacheAction
extends CacheAction

Removes objects from memory without removing them from the Store based on keys.

It interacts with a PassivationStorageHandler to transfer values from the store to a non-memory storage location. This is done in order to reduce memory footprint.


Constructor Summary
PassivatingCacheAction(PassivationStorageHandler handler)
          Creates an action that uses handler for storage.
 
Method Summary
 void onAction(Object key)
          This method is called when the CacheStrategy determines that action is needed for key.
 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.
 
Methods inherited from class com.vignette.portal.cache.CacheAction
getStore, setStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassivatingCacheAction

public PassivatingCacheAction(PassivationStorageHandler handler)

Creates an action that uses handler for storage.

Parameters:
handler - the handler to use to passivate values
Method Detail

onGet

public void onGet(Object key,
                  Map properties)
           throws CacheException
Description copied from class: CacheAction

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.

Overrides:
onGet in class CacheAction
Following copied from class: com.vignette.portal.cache.CacheAction
Parameters:
key - item being looked up
properties - possible overrides, can be null

onGetAll

public void onGetAll(Collection keys,
                     Map properties)
              throws CacheException
Description copied from class: CacheAction

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.

Overrides:
onGetAll in class CacheAction
Following copied from class: com.vignette.portal.cache.CacheAction
Parameters:
keys - items being looked up
properties - possible overrides, can be null

onAdd

public void onAdd(Object key,
                  Object value,
                  Map properties)
Description copied from class: CacheAction

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.

Overrides:
onAdd in class CacheAction
Following copied from class: com.vignette.portal.cache.CacheAction
Parameters:
key - key being inserted in the cache
value - value being inserted in the cache, matching key
properties - possible overrides, can be null

onAddAll

public void onAddAll(Map keyValuePairs,
                     Map properties)
Description copied from class: CacheAction

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.

Overrides:
onAddAll in class CacheAction
Following copied from class: com.vignette.portal.cache.CacheAction
Parameters:
keyValuePairs - key/value pairs being added to the cache
properties - possible overrides, can be null

onRemove

public void onRemove(Object key)
Description copied from class: CacheAction

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.

Overrides:
onRemove in class CacheAction
Following copied from class: com.vignette.portal.cache.CacheAction
Parameters:
key - key being removed from the strategy

onRemoveAll

public void onRemoveAll(Collection keys)
Description copied from class: CacheAction

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.

Overrides:
onRemoveAll in class CacheAction
Following copied from class: com.vignette.portal.cache.CacheAction
Parameters:
keys - keys being removed from the strategy

onRemoveAll

public void onRemoveAll()
Description copied from class: CacheAction

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.

Overrides:
onRemoveAll in class CacheAction

onAction

public void onAction(Object key)
Description copied from class: CacheAction

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.

Overrides:
onAction in class CacheAction
Following copied from class: com.vignette.portal.cache.CacheAction
Parameters:
key - the key for which action is needed

onActions

public void onActions(Collection keys)
Description copied from class: CacheAction

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.

Overrides:
onActions in class CacheAction
Following copied from class: com.vignette.portal.cache.CacheAction
Parameters:
keys - the collection of keys for which action is needed

02/28/2005
 

Copyright and Trademark Notices