@Documented @Target(value={ANNOTATION_TYPE,METHOD,TYPE}) @Retention(value=RUNTIME) public @interface ContainerCache
An annotation to mark a container as cacheable.
It can be used on a method which annotated by ContainerMethod,
or a class which implements cn.crane4j.core.container.Container interface.
The actual cache implementation is determined by what cache manager is specified in the annotation,
when the container is created, the cache factory will be used to create a cache instance,
and wrap the container with cn.crane4j.core.cache.CacheableContainer.
ContainerMethod,
cn.crane4j.core.cache.CacheManager,
cn.crane4j.core.cache.CacheableContainerProcessor,
cn.crane4j.core.support.container.CacheableMethodContainerFactory| 限定符和类型 | 可选元素和说明 |
|---|---|
String |
cacheManager
The name of the cache manager
|
long |
expirationTime
The time to live of the cache,
default to -1L, which means the cache will never proactive evict.
|
TimeUnit |
timeUnit
The time unit of the cache expiry time,
default to
TimeUnit.MILLISECONDS. |
public abstract String cacheManager
cn.crane4j.core.cache.CacheManagerpublic abstract long expirationTime
public abstract TimeUnit timeUnit
TimeUnit.MILLISECONDS.Copyright © 2024. All rights reserved.