org.objectweb.jac.aspects.cache
Interface CacheConf

All Known Implementing Classes:
CacheAC

public interface CacheConf

This aspect handle caching of method results.


Method Summary
 void cache(String classExpr, String methodExpr)
          Specifies that the result of some methods should be cache.
 void cacheWithTimeStamps(String classExpr, String methodExpr, String stampsName)
          Specifies that the result of some methods should be cache.
 void setIgnoredParameters(AbstractMethodItem method, int[] ignored)
          Tells the cache aspect that some parameters of a method should be ignored for all cache operations.
 

Method Detail

cache

public void cache(String classExpr,
                  String methodExpr)
Specifies that the result of some methods should be cache.

If cached method is called twice on the same object with the same parameters, (according to equals()), the method won't be called the second time, and the result of the first invocation will be returned.

Parameters:
classExpr - which classes' method to cache
methodExpr - which methods to cache
See Also:
cacheWithTimeStamps(String,String,String)

cacheWithTimeStamps

public void cacheWithTimeStamps(String classExpr,
                                String methodExpr,
                                String stampsName)
Specifies that the result of some methods should be cache.

Same as cache(), but the cache is invalidated if one of the parameters changed (according to the timestamp aspect) since the cached value was stored.

Parameters:
classExpr - which classes' method to cache
methodExpr - which methods to cache
stampsName - name of the timestamp repository object to use (e.g "timestamps#0")
See Also:
cache(String,String), TimestampConf

setIgnoredParameters

public void setIgnoredParameters(AbstractMethodItem method,
                                 int[] ignored)
Tells the cache aspect that some parameters of a method should be ignored for all cache operations.

As far as the cache is concerned, they will be null.

Parameters:
method - the method to configure
ignored - the indexes of parameters to be ignored (starting at 0)