接口的使用
org.springframework.cache.Cache
使用Cache的程序包 程序包 说明 org.springframework.cache Spring's generic cache abstraction.org.springframework.cache.caffeine Support classes for the open source cache in Caffeine library, allowing to set up Caffeine caches within Spring's cache abstraction.org.springframework.cache.concurrent Implementation package forjava.util.concurrentbased caches.org.springframework.cache.ehcache Support classes for the open source cache EhCache 2.x, allowing to set up an EhCache CacheManager and Caches as beans in a Spring context.org.springframework.cache.interceptor AOP-based solution for declarative caching demarcation.org.springframework.cache.jcache Implementation package for JSR-107 (javax.cache aka "JCache") based caches.org.springframework.cache.support Support classes for the org.springframework.cache package.org.springframework.cache.transaction Transaction-aware decorators for the org.springframework.cache package.org.springframework.web.reactive.config Spring WebFlux configuration infrastructure.org.springframework.web.reactive.resource Support classes for serving static resources.org.springframework.web.servlet.config.annotation Annotation-based setup for Spring MVC.org.springframework.web.servlet.resource Support classes for serving static resources.org.springframework.cache中Cache的使用
返回Cache的org.springframework.cache中的方法 修饰符和类型 方法 说明 CacheCacheManager. getCache(String name)Get the cache associated with the given name.org.springframework.cache.caffeine中Cache的使用
实现Cache的org.springframework.cache.caffeine中的类 修饰符和类型 类 说明 classCaffeineCacheSpringCacheadapter implementation on top of a CaffeineCacheinstance.返回Cache的org.springframework.cache.caffeine中的方法 修饰符和类型 方法 说明 protected CacheCaffeineCacheManager. adaptCaffeineCache(String name, com.github.benmanes.caffeine.cache.Cache<Object,Object> cache)Adapt the given new native Caffeine Cache instance to Spring'sCacheabstraction for the specified cache name.protected CacheCaffeineCacheManager. createCaffeineCache(String name)Build a commonCaffeineCacheinstance for the specified cache name, using the common Caffeine configuration specified on this cache manager.CacheCaffeineCacheManager. getCache(String name)org.springframework.cache.concurrent中Cache的使用
实现Cache的org.springframework.cache.concurrent中的类 修饰符和类型 类 说明 classConcurrentMapCacheSimpleCacheimplementation based on the core JDKjava.util.concurrentpackage.返回Cache的org.springframework.cache.concurrent中的方法 修饰符和类型 方法 说明 protected CacheConcurrentMapCacheManager. createConcurrentMapCache(String name)Create a new ConcurrentMapCache instance for the specified cache name.CacheConcurrentMapCacheManager. getCache(String name)org.springframework.cache.ehcache中Cache的使用
实现Cache的org.springframework.cache.ehcache中的类 修饰符和类型 类 说明 classEhCacheCache返回Cache的org.springframework.cache.ehcache中的方法 修饰符和类型 方法 说明 protected CacheEhCacheCacheManager. getMissingCache(String name)返回变量类型为Cache的类型的org.springframework.cache.ehcache中的方法 修饰符和类型 方法 说明 protected Collection<Cache>EhCacheCacheManager. loadCaches()org.springframework.cache.interceptor中Cache的使用
返回变量类型为Cache的类型的org.springframework.cache.interceptor中的方法 修饰符和类型 方法 说明 protected Collection<? extends Cache>CacheAspectSupport.CacheOperationContext. getCaches()protected Collection<? extends Cache>CacheAspectSupport. getCaches(CacheOperationInvocationContext<CacheOperation> context, CacheResolver cacheResolver)Collection<? extends Cache>AbstractCacheResolver. resolveCaches(CacheOperationInvocationContext<?> context)Collection<? extends Cache>CacheResolver. resolveCaches(CacheOperationInvocationContext<?> context)Return the cache(s) to use for the specified invocation.参数类型为Cache的org.springframework.cache.interceptor中的方法 修饰符和类型 方法 说明 protected voidAbstractCacheInvoker. doClear(Cache cache, boolean immediate)protected voidAbstractCacheInvoker. doEvict(Cache cache, Object key, boolean immediate)Executeevict(Object)/evictIfPresent(Object)on the specifiedCacheand invoke the error handler if an exception occurs.protected Cache.ValueWrapperAbstractCacheInvoker. doGet(Cache cache, Object key)Executeget(Object)on the specifiedCacheand invoke the error handler if an exception occurs.protected voidAbstractCacheInvoker. doPut(Cache cache, Object key, Object result)Executeput(Object, Object)on the specifiedCacheand invoke the error handler if an exception occurs.voidCacheErrorHandler. handleCacheClearError(RuntimeException exception, Cache cache)Handle the given runtime exception thrown by the cache provider when clearing the specifiedCache, possibly rethrowing it as a fatal exception.voidSimpleCacheErrorHandler. handleCacheClearError(RuntimeException exception, Cache cache)voidCacheErrorHandler. handleCacheEvictError(RuntimeException exception, Cache cache, Object key)Handle the given runtime exception thrown by the cache provider when clearing an item with the specifiedkey, possibly rethrowing it as a fatal exception.voidSimpleCacheErrorHandler. handleCacheEvictError(RuntimeException exception, Cache cache, Object key)voidCacheErrorHandler. handleCacheGetError(RuntimeException exception, Cache cache, Object key)Handle the given runtime exception thrown by the cache provider when retrieving an item with the specifiedkey, possibly rethrowing it as a fatal exception.voidSimpleCacheErrorHandler. handleCacheGetError(RuntimeException exception, Cache cache, Object key)voidCacheErrorHandler. handleCachePutError(RuntimeException exception, Cache cache, Object key, Object value)Handle the given runtime exception thrown by the cache provider when updating an item with the specifiedkeyandvalue, possibly rethrowing it as a fatal exception.voidSimpleCacheErrorHandler. handleCachePutError(RuntimeException exception, Cache cache, Object key, Object value)org.springframework.cache.jcache中Cache的使用
实现Cache的org.springframework.cache.jcache中的类 修饰符和类型 类 说明 classJCacheCacheCacheimplementation on top of ajavax.cache.Cacheinstance.返回Cache的org.springframework.cache.jcache中的方法 修饰符和类型 方法 说明 protected CacheJCacheCacheManager. getMissingCache(String name)返回变量类型为Cache的类型的org.springframework.cache.jcache中的方法 修饰符和类型 方法 说明 protected Collection<Cache>JCacheCacheManager. loadCaches()org.springframework.cache.support中Cache的使用
实现Cache的org.springframework.cache.support中的类 修饰符和类型 类 说明 classAbstractValueAdaptingCacheCommon base class forCacheimplementations that need to adaptnullvalues (and potentially other such special values) before passing them on to the underlying store.classNoOpCacheA no operationCacheimplementation suitable for disabling caching.返回Cache的org.springframework.cache.support中的方法 修饰符和类型 方法 说明 protected CacheAbstractCacheManager. decorateCache(Cache cache)Decorate the given Cache object if necessary.CacheAbstractCacheManager. getCache(String name)CacheCompositeCacheManager. getCache(String name)CacheNoOpCacheManager. getCache(String name)This implementation always returns aCacheimplementation that will not store items.protected CacheAbstractCacheManager. getMissingCache(String name)Return a missing cache with the specifiedname, ornullif such a cache does not exist or could not be created on demand.protected CacheAbstractCacheManager. lookupCache(String name)Check for a registered cache of the given name.返回变量类型为Cache的类型的org.springframework.cache.support中的方法 修饰符和类型 方法 说明 protected abstract Collection<? extends Cache>AbstractCacheManager. loadCaches()Load the initial caches for this cache manager.protected Collection<? extends Cache>SimpleCacheManager. loadCaches()参数类型为Cache的org.springframework.cache.support中的方法 修饰符和类型 方法 说明 protected voidAbstractCacheManager. addCache(Cache cache)已过时。as of Spring 4.3, in favor ofAbstractCacheManager.getMissingCache(String)protected CacheAbstractCacheManager. decorateCache(Cache cache)Decorate the given Cache object if necessary.类型变量类型为Cache的org.springframework.cache.support中的方法参数 修饰符和类型 方法 说明 voidSimpleCacheManager. setCaches(Collection<? extends Cache> caches)Specify the collection of Cache instances to use for this CacheManager.org.springframework.cache.transaction中Cache的使用
实现Cache的org.springframework.cache.transaction中的类 修饰符和类型 类 说明 classTransactionAwareCacheDecoratorCache decorator which synchronizes itsTransactionAwareCacheDecorator.put(java.lang.Object, java.lang.Object),TransactionAwareCacheDecorator.evict(java.lang.Object)andTransactionAwareCacheDecorator.clear()operations with Spring-managed transactions (through Spring'sTransactionSynchronizationManager, performing the actual cache put/evict/clear operation only in the after-commit phase of a successful transaction.返回Cache的org.springframework.cache.transaction中的方法 修饰符和类型 方法 说明 protected CacheAbstractTransactionSupportingCacheManager. decorateCache(Cache cache)CacheTransactionAwareCacheManagerProxy. getCache(String name)CacheTransactionAwareCacheDecorator. getTargetCache()Return the target Cache that this Cache should delegate to.参数类型为Cache的org.springframework.cache.transaction中的方法 修饰符和类型 方法 说明 protected CacheAbstractTransactionSupportingCacheManager. decorateCache(Cache cache)参数类型为Cache的org.springframework.cache.transaction中的构造器 构造器 说明 TransactionAwareCacheDecorator(Cache targetCache)Create a new TransactionAwareCache for the given target Cache.org.springframework.web.reactive.config中Cache的使用
参数类型为Cache的org.springframework.web.reactive.config中的方法 修饰符和类型 方法 说明 ResourceChainRegistrationResourceHandlerRegistration. resourceChain(boolean cacheResources, Cache cache)Configure a chain of resource resolvers and transformers to use.参数类型为Cache的org.springframework.web.reactive.config中的构造器 构造器 说明 ResourceChainRegistration(boolean cacheResources, Cache cache)org.springframework.web.reactive.resource中Cache的使用
返回Cache的org.springframework.web.reactive.resource中的方法 修饰符和类型 方法 说明 CacheCachingResourceResolver. getCache()Return the configuredCache.CacheCachingResourceTransformer. getCache()Return the configuredCache.参数类型为Cache的org.springframework.web.reactive.resource中的构造器 构造器 说明 CachingResourceResolver(Cache cache)CachingResourceTransformer(Cache cache)org.springframework.web.servlet.config.annotation中Cache的使用
参数类型为Cache的org.springframework.web.servlet.config.annotation中的方法 修饰符和类型 方法 说明 ResourceChainRegistrationResourceHandlerRegistration. resourceChain(boolean cacheResources, Cache cache)Configure a chain of resource resolvers and transformers to use.参数类型为Cache的org.springframework.web.servlet.config.annotation中的构造器 构造器 说明 ResourceChainRegistration(boolean cacheResources, Cache cache)org.springframework.web.servlet.resource中Cache的使用
返回Cache的org.springframework.web.servlet.resource中的方法 修饰符和类型 方法 说明 CacheCachingResourceResolver. getCache()Return the configuredCache.CacheCachingResourceTransformer. getCache()Return the configuredCache.参数类型为Cache的org.springframework.web.servlet.resource中的构造器 构造器 说明 CachingResourceResolver(Cache cache)CachingResourceTransformer(Cache cache)