注释类型 Cached
- 作者:
- huangli
-
可选元素概要
可选元素修饰符和类型可选元素说明If you want to use multi backend cache system, you can setup multi "cache area" in configuration, this attribute specifies the name of the "cache area" you want to use.booleanSpecify whether a null value should be cached.Type of the Cache instance.Expression script used for conditioning the method caching, the cache is not used when evaluation result is false.booleanSpecify whether the method caching is enabled.intThe expire time.Specify the key by expression script, optional.Specify the key convertor.intUse to specify the local cache expire time when cacheType=CacheType.BOTH, use "expire" if absent.intSpecify max elements in local memory when cacheType is CacheType.LOCAL or CacheType.BOTH.The name of this Cache instance, optional.Expression script used for conditioning the method cache updating, the cache updating action is vetoed when the evaluation result is false.Specify the serialization policy of remote cache when cacheType is CacheType.REMOTE or CacheType.BOTH.booleanif cacheType is CacheType.BOTH and the remote cache supports broadcast (or BroadcastManager bean exists), invalidate local cache of all process after put/remove operation.Specify the time unit of expire.
-
元素详细资料
-
area
String areaIf you want to use multi backend cache system, you can setup multi "cache area" in configuration, this attribute specifies the name of the "cache area" you want to use.- 返回:
- the name of cache area
- 默认值:
- "default"
-
name
String nameThe name of this Cache instance, optional. If you do not specify, JetCache will auto generate one. The name is used to display statistics information and as part of key prefix when using a remote cache. Do not assign same name to different @Cached annotation which with same area.- 返回:
- the name of the cache
- 默认值:
- "$$undefined$$"
-
enabled
boolean enabledSpecify whether the method caching is enabled. If set to false, you can enable it in thread context usingCacheContext.enableCache(Supplier<T> callback)- 返回:
- if the method cache is enabled
- 默认值:
- true
-
timeUnit
TimeUnit timeUnitSpecify the time unit of expire.- 返回:
- the time unit of expire time
- 默认值:
- SECONDS
-
expire
int expireThe expire time. Use global config if the attribute value is absent, and if the global config is not defined either, use infinity instead.- 返回:
- the expire time
- 默认值:
- -2147483648
-
localExpire
int localExpireUse to specify the local cache expire time when cacheType=CacheType.BOTH, use "expire" if absent.- 返回:
- the local cache expire time
- 默认值:
- -2147483648
-
cacheType
CacheType cacheTypeType of the Cache instance. May be CacheType.REMOTE, CacheType.LOCAL, CacheType.BOTH. Create a two level cache (local+remote) when value is CacheType.BOTH.- 返回:
- cache type of the method cache
- 默认值:
- REMOTE
-
syncLocal
boolean syncLocalif cacheType is CacheType.BOTH and the remote cache supports broadcast (or BroadcastManager bean exists), invalidate local cache of all process after put/remove operation.- 返回:
- should sync local cache
- 默认值:
- false
-
localLimit
int localLimitSpecify max elements in local memory when cacheType is CacheType.LOCAL or CacheType.BOTH. Use global config if the attribute value is absent, and if the global config is not defined either, use CacheConsts.DEFAULT_LOCAL_LIMIT instead.- 返回:
- local maximal elements of the LOCAL/BOTH cache
- 默认值:
- -2147483648
-
serialPolicy
String serialPolicySpecify the serialization policy of remote cache when cacheType is CacheType.REMOTE or CacheType.BOTH. The JetCache build-in serialPolicy are SerialPolicy.JAVA or SerialPolicy.KRYO. Use global config if the attribute value is absent, and if the global config is not defined either, use SerialPolicy.JAVA instead.- 返回:
- the serialization policy name of cache value
- 默认值:
- "$$undefined$$"
-
keyConvertor
String keyConvertorSpecify the key convertor. Used to convert the complex key object. The JetCache build-in keyConvertor are KeyConvertor.FASTJSON or KeyConvertor.NONE. NONE indicate do not convert, FASTJSON will use fastjson to convert key object to a string. Use global config if the attribute value is absent.- 返回:
- convertor name of cache key
- 默认值:
- "$$undefined$$"
-
key
String keySpecify the key by expression script, optional. If not specified, use all parameters of the target method and keyConvertor to generate one.- 返回:
- an expression script which specifies key
- 默认值:
- "$$undefined$$"
-
cacheNullValue
boolean cacheNullValueSpecify whether a null value should be cached.- 返回:
- whether a null value should be cached
- 默认值:
- false
-
condition
String conditionExpression script used for conditioning the method caching, the cache is not used when evaluation result is false. Evaluation occurs before real method invocation.- 默认值:
- "$$undefined$$"
-
postCondition
String postConditionExpression script used for conditioning the method cache updating, the cache updating action is vetoed when the evaluation result is false. Evaluation occurs after real method invocation so we can refer result in script.- 默认值:
- "$$undefined$$"
-