Class 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 Detail

      • NULL_VALUE_WRAPPER

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

      • SpringCache

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

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

      • 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)
      • 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()
      • getWriteTimeout

        public long getWriteTimeout()