Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

cern::gp::nodes::cache::TimeLimitedCachingStrategy Class Reference

Inheritance diagram for cern::gp::nodes::cache::TimeLimitedCachingStrategy:

Inheritance graph
[legend]
Collaboration diagram for cern::gp::nodes::cache::TimeLimitedCachingStrategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TimeLimitedCachingStrategy (int timeoutMillis)
boolean isCacheValid ()
void validateCache ()
void invalidateCache ()

Private Attributes

final int timeoutMillis
long lastAccessTimeMillis

Detailed Description

A caching strategy based on a given time. The objects are cached for a given fixed time that is given at construction time

Author:
Vito Baggiolini
Version:
Revision
1.2
Date
2006/09/25 08:52:36


Constructor & Destructor Documentation

cern::gp::nodes::cache::TimeLimitedCachingStrategy::TimeLimitedCachingStrategy int  timeoutMillis  )  [inline]
 

Constructs a new caching strategy based on the given time

Parameters:
timeoutMillis the timeout for the cache


Member Function Documentation

void cern::gp::nodes::cache::TimeLimitedCachingStrategy::invalidateCache  )  [inline]
 

Invalidates the current cached value. This method is called to signal that the cached value should not be used anymore.

Implements cern::gp::nodes::cache::CachingStrategy.

boolean cern::gp::nodes::cache::TimeLimitedCachingStrategy::isCacheValid  )  [inline]
 

Checks whether the cache is still valid. If true is returned the cached value will be used. If false is returned the cached value will be discarded and the getter will be invoked to get a new value.

Returns:
true if the cache is still valid

Implements cern::gp::nodes::cache::CachingStrategy.

void cern::gp::nodes::cache::TimeLimitedCachingStrategy::validateCache  )  [inline]
 

Validates the current cached value. This method is called to signal that the cached value has just been updated. The strategy should take this event into account for the implementation of isCached()

Implements cern::gp::nodes::cache::CachingStrategy.


Member Data Documentation

long cern::gp::nodes::cache::TimeLimitedCachingStrategy::lastAccessTimeMillis [private]
 

final int cern::gp::nodes::cache::TimeLimitedCachingStrategy::timeoutMillis [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:08:32 2009 for ACS Java API by doxygen 1.3.8