Package jetbrains.buildServer.util.cache
Class CacheProviderImpl
- java.lang.Object
-
- jetbrains.buildServer.util.cache.CacheProviderImpl
-
- All Implemented Interfaces:
CacheProvider
public class CacheProviderImpl extends Object implements CacheProvider
- Author:
- kir
-
-
Constructor Summary
Constructors Constructor Description CacheProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
destroyCache(String cacheName)
Removes cache with specified name.<T extends Serializable>
SCache<T>getOrCreateCache(String cacheName, Class<T> cachedItemsClass)
Create or get existing named disk-based cache.<T> SCache<T>
getOrCreateCache(String cacheName, Class<T> cachedItemsClass, int timeToLiveSeconds, boolean inMemoryOnly)
Create or get existing named cache.<T> SCache<T>
getOrCreateCache(String cacheName, Class<T> cachedItemsClass, int timeToLiveSeconds, int timeToIdleSeconds, boolean inMemoryOnly)
Create or get existing named cache.void
setCacheUtil(EhCacheHelper cacheUtil)
-
-
-
Method Detail
-
setCacheUtil
public void setCacheUtil(@NotNull EhCacheHelper cacheUtil)
-
getOrCreateCache
@NotNull public <T extends Serializable> SCache<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 interfaceCacheProvider
-
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 interfaceCacheProvider
- Parameters:
cacheName
- cache nametimeToLiveSeconds
- 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 interfaceCacheProvider
- Parameters:
cacheName
- cache nametimeToLiveSeconds
- 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 interfaceCacheProvider
- Parameters:
cacheName
- name of the cache- Returns:
- true if cache destroyed, and false some error occurred and cache could not be destroyed
-
-