Class CacheProviderImpl

    • Constructor Detail

      • CacheProviderImpl

        public CacheProviderImpl()
    • Method Detail

      • setCacheUtil

        public void setCacheUtil​(@NotNull
                                 EhCacheHelper cacheUtil)
      • getOrCreateCache

        @NotNull
        public <T extends SerializableSCache<T> getOrCreateCache​(String cacheName,
                                                                   Class<T> cachedItemsClass)
        Description copied from interface: CacheProvider
        Create or get existing named disk-based cache. If new cache is created, the resulting cache data will be persisted to disk. The data is stored in the cache unlimited time.
        Specified by:
        getOrCreateCache in interface CacheProvider
      • getOrCreateCache

        @NotNull
        public <T> SCache<T> getOrCreateCache​(String cacheName,
                                              Class<T> cachedItemsClass,
                                              int timeToLiveSeconds,
                                              boolean inMemoryOnly)
        Description copied from interface: CacheProvider
        Create or get existing named cache. NOTE: 'cachedItemsClass' should implement java.io.Serializable if 'inMemoryOnly' is false.
        Specified by:
        getOrCreateCache in interface CacheProvider
        Parameters:
        cacheName - cache name
        timeToLiveSeconds - time to live value for all values put to the cache (0 means eternal)
        inMemoryOnly - if true, cache will never be put on the disk
        Returns:
        cache object
      • getOrCreateCache

        @NotNull
        public <T> SCache<T> getOrCreateCache​(String cacheName,
                                              Class<T> cachedItemsClass,
                                              int timeToLiveSeconds,
                                              int timeToIdleSeconds,
                                              boolean inMemoryOnly)
        Description copied from interface: CacheProvider
        Create or get existing named cache. NOTE: 'cachedItemsClass' should implement java.io.Serializable if 'inMemoryOnly' is false.
        Specified by:
        getOrCreateCache in interface CacheProvider
        Parameters:
        cacheName - cache name
        timeToLiveSeconds - time to live value for all values put to the cache (0 means eternal)
        timeToIdleSeconds - time to idle value for all values put to the cache (0 means eternal)
        inMemoryOnly - if true, cache will never be put on the disk
        Returns:
        cache object
      • destroyCache

        public boolean destroyCache​(@NotNull
                                    String cacheName)
        Description copied from interface: CacheProvider
        Removes cache with specified name. For persistent caches removes cache data from disk as well.
        Specified by:
        destroyCache in interface CacheProvider
        Parameters:
        cacheName - name of the cache
        Returns:
        true if cache destroyed, and false some error occurred and cache could not be destroyed