Class SpringCache

  • All Implemented Interfaces:
    org.springframework.cache.Cache

    public class SpringCache
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      void evict​(java.lang.Object key)  
      org.springframework.cache.Cache.ValueWrapper get​(java.lang.Object key)  
      <T> T get​(java.lang.Object key, java.lang.Class<T> type)  
      <T> T get​(java.lang.Object key, java.util.concurrent.Callable<T> valueLoader)  
      java.lang.String getName()  
      BasicCache<?,​?> getNativeCache()  
      void put​(java.lang.Object key, java.lang.Object value)  
      void put​(java.lang.Object key, java.lang.Object value, long lifespan, java.util.concurrent.TimeUnit unit)  
      org.springframework.cache.Cache.ValueWrapper putIfAbsent​(java.lang.Object key, java.lang.Object value)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SpringCache

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

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

      • getName

        public java.lang.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​(java.lang.Object key)
        Specified by:
        get in interface org.springframework.cache.Cache
        See Also:
        Cache.get(Object)
      • get

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

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

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

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

        public void evict​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()