Package jetbrains.buildServer.util.cache
Class EhCacheUtilBase
- java.lang.Object
-
- jetbrains.buildServer.util.cache.EhCacheUtilBase
-
- All Implemented Interfaces:
EhCacheHelper
- Direct Known Subclasses:
EhCacheUtil
public class EhCacheUtilBase extends Object implements EhCacheHelper
A helper class designed to simplify the work with EhCache library. See the doc for more details. Typical usage:public MyBean { private Cache myCache; public MyBean(@NotNull EhCacheUtil cacheUtil) { myCache = cacheUtil.createCache("my-cache-name"); } ... }Note: if your cache is not eternal (in ehcache configuration), it will be cleaned up if requested from admin interface or API. Default cache not eternal.- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPACT_ENABLED_PROPERTYstatic StringCOMPACT_MIN_PERIOD_PROPERTYstatic StringCOMPACT_TRIGGER_SIZE_PROPERTY
-
Constructor Summary
Constructors Constructor Description EhCacheUtilBase(EhCacheUtilPaths serverPaths, ResetCacheRegister register)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.sf.ehcache.CachecreateCache(String name)net.sf.ehcache.CachecreateCache(String configText, String name, Map<String,String> params)net.sf.ehcache.CachecreateInMemoryCache(String name)booleandestroyCache(String name)Destroys cache with specified name - disposes cache and removes all its data including files stored on disk if cache is persistent.voiddisposeCache(String name)Disposes (flushes on disk and frees resources) a cache with given nameprotected net.sf.ehcache.CacheManagergetCacheManager(String configText, Map<String,String> cacheParams)voidshutdownCaches()
-
-
-
Field Detail
-
COMPACT_ENABLED_PROPERTY
public static final String COMPACT_ENABLED_PROPERTY
- See Also:
- Constant Field Values
-
COMPACT_TRIGGER_SIZE_PROPERTY
public static final String COMPACT_TRIGGER_SIZE_PROPERTY
- See Also:
- Constant Field Values
-
COMPACT_MIN_PERIOD_PROPERTY
public static final String COMPACT_MIN_PERIOD_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EhCacheUtilBase
public EhCacheUtilBase(@NotNull EhCacheUtilPaths serverPaths, @NotNull ResetCacheRegister register)
-
-
Method Detail
-
shutdownCaches
public void shutdownCaches()
-
getCacheManager
@Nullable protected net.sf.ehcache.CacheManager getCacheManager(@NotNull String configText, @NotNull Map<String,String> cacheParams)
-
createCache
@NotNull public net.sf.ehcache.Cache createCache(@NotNull String configText, @NotNull String name, @NotNull Map<String,String> params)
-
createCache
@NotNull public net.sf.ehcache.Cache createCache(@NotNull String name)- Specified by:
createCachein interfaceEhCacheHelper
-
createInMemoryCache
@NotNull public net.sf.ehcache.Cache createInMemoryCache(@NotNull String name)- Specified by:
createInMemoryCachein interfaceEhCacheHelper
-
disposeCache
public void disposeCache(@NotNull String name)Description copied from interface:EhCacheHelperDisposes (flushes on disk and frees resources) a cache with given name- Specified by:
disposeCachein interfaceEhCacheHelper
-
destroyCache
public boolean destroyCache(@NotNull String name)Description copied from interface:EhCacheHelperDestroys cache with specified name - disposes cache and removes all its data including files stored on disk if cache is persistent.- Specified by:
destroyCachein interfaceEhCacheHelper- Parameters:
name- cache name- Returns:
- true if cache destroyed, and false some error occurred and cache could not be destroyed
-
-