org.objectweb.jac.aspects.cache
Class CacheAC

java.lang.Object
  extended byorg.objectweb.jac.core.AspectComponent
      extended byorg.objectweb.jac.aspects.cache.CacheAC
All Implemented Interfaces:
BaseProgramListener, CacheConf, Serializable

public class CacheAC
extends AspectComponent
implements CacheConf

This aspect handle caching of method results.

See Also:
Serialized Form

Field Summary
static String IGNORED_PARAMETERS
           
 
Fields inherited from class org.objectweb.jac.core.AspectComponent
application, blockKeywords, cr, currentConfigMethod, currentImports, firstCall, NOT_SHARED, SHARED, startWeavingCCount, startWeavingCount, startWeavingMethod, startWeavingType, systemListener, wrappers
 
Fields inherited from interface org.objectweb.jac.core.BaseProgramListener
FOUND_OBJECT
 
Constructor Summary
CacheAC()
           
 
Method Summary
 void cache(String classExpr, String methodExpr)
          Cache a method result.
 void cacheWithTimeStamps(String classExpr, String methodExpr, String stampsName)
          Specifies that the result of some methods should be cache.
 void invalidateCache()
           
 void setIgnoredParameters(AbstractMethodItem method, int[] ignored)
          Tells the cache aspect that some parameters of a method should be ignored for all cache operations.
 
Methods inherited from class org.objectweb.jac.core.AspectComponent
addWrapper, afterApplicationStarted, afterRunningWrapper, afterWrap, afterWrappeeInit, attr, attrdef, beforeConfiguration, beforeReload, beforeRunningWrapper, beforeWrappeeInit, configure, defines, defineTimer, doRegister, doUnregister, error, getAC, getApplication, getBlockKeywords, getConfigurationMethods, getConfigurationMethodsName, getConfigurationMethodsName, getDefaultConfigs, getName, getNameCounters, getWrappers, init, isConfigurationMethod, isSystemListener, onExit, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, setApplication, setAttribute, setAttribute, setAttribute, setSystemListener, simulateUsingNewInstance, unweave, unwrapAll, updateNameCounters, warning, weave, whenClone, whenCloseDisplay, whenConfigured, whenDeleted, whenDeserialized, whenFree, whenGetObjects, whenNameObject, whenObjectMiss, whenReload, whenRemoteInstantiation, whenSerialized, whenTopologyChanged, whenUsingNewClass, whenUsingNewInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IGNORED_PARAMETERS

public static final String IGNORED_PARAMETERS
See Also:
Constant Field Values
Constructor Detail

CacheAC

public CacheAC()
Method Detail

cache

public void cache(String classExpr,
                  String methodExpr)
Cache a method result.

Specified by:
cache in interface CacheConf
Parameters:
classExpr - the classes
methodExpr - the methods cached
See Also:
CacheConf.cacheWithTimeStamps(String,String,String)

cacheWithTimeStamps

public void cacheWithTimeStamps(String classExpr,
                                String methodExpr,
                                String stampsName)
Description copied from interface: CacheConf
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.

Specified by:
cacheWithTimeStamps in interface CacheConf
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:
CacheConf.cache(String,String), TimestampConf

setIgnoredParameters

public void setIgnoredParameters(AbstractMethodItem method,
                                 int[] ignored)
Description copied from interface: CacheConf
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.

Specified by:
setIgnoredParameters in interface CacheConf
Parameters:
method - the method to configure
ignored - the indexes of parameters to be ignored (starting at 0)

invalidateCache

public void invalidateCache()