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
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.cache.Cache

    org.springframework.cache.Cache.ValueRetrievalException, org.springframework.cache.Cache.ValueWrapper
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.springframework.cache.support.SimpleValueWrapper
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpringCache(org.infinispan.commons.api.BasicCache nativeCache)
     
    SpringCache(org.infinispan.commons.api.BasicCache nativeCache, long readTimeout, long writeTimeout)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    org.springframework.cache.Cache.ValueWrapper
    get(Object key)
     
    <T> T
    get(Object key, Class<T> type)
     
    <T> T
    get(Object key, Callable<T> valueLoader)
     
     
    org.infinispan.commons.api.BasicCache<?,?>
     
    long
     
    void
    put(Object key, Object value)
     
    void
    put(Object key, Object value, long lifespan, TimeUnit unit)
     
    org.springframework.cache.Cache.ValueWrapper
    putIfAbsent(Object key, Object value)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.cache.Cache

    evictIfPresent, invalidate
  • Field Details

    • NULL_VALUE_WRAPPER

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

    • SpringCache

      public SpringCache(org.infinispan.commons.api.BasicCache nativeCache)
      Parameters:
      nativeCache - underlying cache
    • SpringCache

      public SpringCache(org.infinispan.commons.api.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 org.infinispan.commons.api.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:
      • BasicCache.put(Object, Object, long, TimeUnit)
    • 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()