Class SpringCache

java.lang.Object
org.infinispan.spring.common.provider.SpringCache
All Implemented Interfaces:
org.springframework.cache.Cache

public class SpringCache extends Object implements org.springframework.cache.Cache

A Cache implementation that delegates to a org.infinispan.Cache instance supplied at construction time.

Author:
Olaf Bergner, Marius Bogoevici
  • Field Details

    • NULL_VALUE_WRAPPER

      public static final org.springframework.cache.support.SimpleValueWrapper NULL_VALUE_WRAPPER
  • Constructor Details

    • SpringCache

      public SpringCache(BasicCache nativeCache)
      Parameters:
      nativeCache - underlying cache
    • SpringCache

      public SpringCache(BasicCache nativeCache, long readTimeout, long writeTimeout)
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.springframework.cache.Cache
      See Also:
      • Cache.getName()
    • getNativeCache

      public BasicCache<?,?> getNativeCache()
      Specified by:
      getNativeCache in interface org.springframework.cache.Cache
      See Also:
      • Cache.getNativeCache()
    • get

      public org.springframework.cache.Cache.ValueWrapper get(Object key)
      Specified by:
      get in interface org.springframework.cache.Cache
      See Also:
      • Cache.get(Object)
    • get

      public <T> T get(Object key, Class<T> type)
      Specified by:
      get in interface org.springframework.cache.Cache
    • get

      public <T> T get(Object key, Callable<T> valueLoader)
      Specified by:
      get in interface org.springframework.cache.Cache
    • put

      public void put(Object key, Object value)
      Specified by:
      put in interface org.springframework.cache.Cache
      See Also:
      • Cache.put(Object, Object)
    • put

      public void put(Object key, Object value, long lifespan, TimeUnit unit)
      See Also:
    • putIfAbsent

      public org.springframework.cache.Cache.ValueWrapper putIfAbsent(Object key, Object value)
      Specified by:
      putIfAbsent in interface org.springframework.cache.Cache
    • evict

      public void evict(Object key)
      Specified by:
      evict in interface org.springframework.cache.Cache
      See Also:
      • Cache.evict(Object)
    • clear

      public void clear()
      Specified by:
      clear in interface org.springframework.cache.Cache
      See Also:
      • Cache.clear()
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • getWriteTimeout

      public long getWriteTimeout()