Class SpringCache

  • All Implemented Interfaces:

    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.

    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()  
      long getWriteTimeout()  
      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
      • Methods inherited from interface org.springframework.cache.Cache

        evictIfPresent, invalidate
    • Constructor Detail

      • SpringCache

        public SpringCache​(BasicCache nativeCache)
        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:
      • getNativeCache

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

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

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

        public java.lang.String toString()
        toString in class java.lang.Object
        See Also:
      • getWriteTimeout

        public long getWriteTimeout()