org.onebusaway.container.cache
@Retention(value=RUNTIME) @Target(value=METHOD) public @interface Cacheable
CacheableAnnotationInterceptor
. The bulk of the caching
mechanism is provided by CacheableMethodManager
, 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.
The keyFactory()
method allows an extension mechanism to define a
CacheableMethodKeyFactory
that determines how the arguments to a
particular method will be used to generate a cache key. By default, the
DefaultCacheableKeyFactory
factory is used, which simply uses
DefaultCacheableObjectKeyFactory
factories to generate a key for each
argument, unless otherwise specified with a CacheableKey
annotation.CacheableAnnotationInterceptor
,
CacheableMethodKeyFactory
,
CacheableMethodManager
Modifier and Type | Optional Element and Description |
---|---|
boolean |
isValueSerializable |
Class<? extends CacheableMethodKeyFactory> |
keyFactory |
public abstract Class<? extends CacheableMethodKeyFactory> keyFactory
public abstract boolean isValueSerializable
Copyright © 2014 OneBusAway. All Rights Reserved.