02/28/2005
 

com.vignette.portal.cache
Class LiveUntilUnusedStrategy

java.lang.Object
  |
  +--com.vignette.portal.cache.CacheStrategy
        |
        +--com.vignette.portal.cache.ActionBasedCacheStrategy
              |
              +--com.vignette.portal.cache.TimeBasedStrategy
                    |
                    +--com.vignette.portal.cache.LiveUntilUnusedStrategy
All Implemented Interfaces:
Periodical

public class LiveUntilUnusedStrategy
extends TimeBasedStrategy

Computes expiration time based on last access.


Constructor Summary
LiveUntilUnusedStrategy(CacheAction action, long defaultTimeout)
          Creates a cache with specified timeout and with specified action logic.
LiveUntilUnusedStrategy(long defaultTimeout)
          Creates a cache with specified timeout and with default action logic.
 
Method Summary
 void onGet(Object key, Map properties)
          Someone is accessing key in the Cache.
 
Methods inherited from class com.vignette.portal.cache.TimeBasedStrategy
containsKey, getDefaultTimeout, getNeverExpireProperty, getOverrideTimeoutProperty, onAdd, onInvalidate, onInvalidateAll, onInvalidateAll, onPeriod, onPut, onPutAll, onRemove, onRemoveAll, onRemoveAll, updateExpirationTime
 
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

LiveUntilUnusedStrategy

public LiveUntilUnusedStrategy(long defaultTimeout)

Creates a cache with specified timeout and with default action logic.

Parameters:
defaultTimeout - the maximum time, in milliseconds, that objects are allowed in the cache.
See Also:
TimeBasedStrategy.TimeBasedStrategy(long)

LiveUntilUnusedStrategy

public LiveUntilUnusedStrategy(CacheAction action,
                               long defaultTimeout)

Creates a cache with specified timeout and with specified action logic.

Parameters:
action - the non-null action to invoke when the size of the cache is exceeded.
defaultTimeout - the maximum time, in milliseconds, that objects are allowed in the cache.
See Also:
TimeBasedStrategy.TimeBasedStrategy(CacheAction, long)
Method Detail

onGet

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

Someone is accessing key in the Cache.

Individual strategies can use the information in properties to override their creation-time parameters.

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

02/28/2005
 

Copyright and Trademark Notices