Class EhCache

  • All Implemented Interfaces:
    org.silverpeas.kernel.cache.model.Cache, org.silverpeas.kernel.cache.model.SimpleCache

    public final class EhCache
    extends org.silverpeas.kernel.cache.model.ExternalCache
    Implementation of the external cache by using the EhCache API. This cache is loaded and used by the ApplicationCacheAccessor through the Java SPI mechanism.
    Author:
    Yohann Chastagnier
    See Also:
    ExternalCache, ApplicationCacheAccessor
    • Constructor Detail

      • EhCache

        public EhCache()
        Constructs the EhCache cache. The maximum number of elements the cache can be contained is provided by the property application.cache.common.nbMaxElements in the general Silverpeas settings. This method is dedicated to be used by the Java SPI mechanism.
    • Method Detail

      • clear

        public void clear()
      • remove

        public <T> T remove​(Object key,
                            Class<T> classType)
      • put

        public void put​(Object key,
                        Object value,
                        int timeToLive,
                        int timeToIdle)
      • computeIfAbsent

        public <T> T computeIfAbsent​(Object key,
                                     Class<T> classType,
                                     int timeToLive,
                                     int timeToIdle,
                                     Supplier<T> valueSupplier)
      • getAll

        public Map<Object,​Object> getAll()
        Specified by:
        getAll in class org.silverpeas.kernel.cache.model.AbstractSimpleCache