Class InjectedCacheResolverFactory

java.lang.Object
org.infinispan.jcache.embedded.InjectedCacheResolverFactory
All Implemented Interfaces:
javax.cache.annotation.CacheResolverFactory

public class InjectedCacheResolverFactory extends Object implements javax.cache.annotation.CacheResolverFactory
CacheResolverFactory implementation that looks up the cache by name in all the EmbeddedCacheManager beans that exist in the CDI container. If a cache with the required cache name does not exist yet, it is created in the @Default EmbeddedCacheManager bean. Example:

 @CacheResult(cacheName = "bla", cacheResolverFactory = InjectedCacheResolverFactory.class)
 public String cachedMethod() {
    ...
 }
 
Since:
13.0
Author:
Dan Berindei
  • Constructor Details

    • InjectedCacheResolverFactory

      public InjectedCacheResolverFactory()
  • Method Details

    • getCacheResolver

      public javax.cache.annotation.CacheResolver getCacheResolver(javax.cache.annotation.CacheMethodDetails<? extends Annotation> cacheMethodDetails)
      Specified by:
      getCacheResolver in interface javax.cache.annotation.CacheResolverFactory
    • getExceptionCacheResolver

      public javax.cache.annotation.CacheResolver getExceptionCacheResolver(javax.cache.annotation.CacheMethodDetails<javax.cache.annotation.CacheResult> cacheMethodDetails)
      Specified by:
      getExceptionCacheResolver in interface javax.cache.annotation.CacheResolverFactory