Class JCacheCache

java.lang.Object
org.springframework.cache.support.AbstractValueAdaptingCache
org.springframework.cache.jcache.JCacheCache
All Implemented Interfaces:
org.springframework.cache.Cache

public class JCacheCache extends org.springframework.cache.support.AbstractValueAdaptingCache
Cache implementation on top of a javax.cache.Cache instance.

Note: This class has been updated for JCache 1.0, as of Spring 4.0.

Since:
3.2
Author:
Juergen Hoeller, Stephane Nicoll
See Also:
  • Constructor Details

    • JCacheCache

      public JCacheCache(javax.cache.Cache<Object,Object> jcache)
      Create a JCacheCache instance.
      Parameters:
      jcache - backing JCache Cache instance
    • JCacheCache

      public JCacheCache(javax.cache.Cache<Object,Object> jcache, boolean allowNullValues)
      Create a JCacheCache instance.
      Parameters:
      jcache - backing JCache Cache instance
      allowNullValues - whether to accept and convert null values for this cache
  • Method Details

    • getName

      public final String getName()
    • getNativeCache

      public final javax.cache.Cache<Object,Object> getNativeCache()
    • lookup

      @Nullable protected Object lookup(Object key)
      Specified by:
      lookup in class org.springframework.cache.support.AbstractValueAdaptingCache
    • get

      @Nullable public <T> T get(Object key, Callable<T> valueLoader)
    • put

      public void put(Object key, @Nullable Object value)
    • putIfAbsent

      @Nullable public org.springframework.cache.Cache.ValueWrapper putIfAbsent(Object key, @Nullable Object value)
    • evict

      public void evict(Object key)
    • evictIfPresent

      public boolean evictIfPresent(Object key)
    • clear

      public void clear()
    • invalidate

      public boolean invalidate()