Package org.onebusaway.container.cache
Annotation Type Cacheable
-
@Retention(RUNTIME) @Target(METHOD) public @interface Cacheable
A method annotation that indicates that the results method are cacheable, using the arguments to the method as the cache key. Method calls are intercepted using an Aspect-oriented interceptor, as implemented inCacheableAnnotationInterceptor. The bulk of the caching mechanism is provided byCacheableMethodManager, which handles the actual task of generating a cache key for a particular method call, determining if a cached results exists, and generating a fresh result as needed by completing the underlying method call. EhCache is used as the default caching mechanism. Unless otherwise specified with#name(), each method cache name takes the form of "package.SomeClass.methodName". Use standard EhCache configuration to provide specific cache behavior for a particular cached method call. ThekeyFactory()method allows an extension mechanism to define aCacheableMethodKeyFactorythat determines how the arguments to a particular method will be used to generate a cache key. By default, theDefaultCacheableKeyFactoryfactory is used, which simply usesDefaultCacheableObjectKeyFactoryfactories to generate a key for each argument, unless otherwise specified with aCacheableKeyannotation.- Author:
- bdferris
- See Also:
CacheableAnnotationInterceptor,CacheableMethodKeyFactory,CacheableMethodManager
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanisValueSerializableClass<? extends CacheableMethodKeyFactory>keyFactory
-
-
-
Element Detail
-
keyFactory
Class<? extends CacheableMethodKeyFactory> keyFactory
- Returns:
- a factory class for creating cache keys from method arguments
- Default:
- org.onebusaway.container.cache.CacheableMethodKeyFactory.class
-
-