public class CacheFactory extends CacheService
Here are the methods that should be called to create new instances of caches.
Cache| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CACHE |
settingsBean| Modifier and Type | Method and Description |
|---|---|
protected <K,V> Cache<K,V> |
createCacheInstance(String name,
String cacheProvider) |
void |
flushAllCaches()
Flush all the cache entries of all the registered caches.
|
Cache |
getCache(String name)
Retrieves the specified
region cache. |
<K,V> Cache<K,V> |
getCache(String name,
boolean forceCreation)
Returns the requested cache or creates it if it does not exist yet and
forceCreation is set to true. |
Map<String,String> |
getCacheProviderForCache() |
Map<String,CacheProvider> |
getCacheProviders() |
static CacheFactory |
getInstance()
Return the unique instance of this class.
|
Set<String> |
getNames()
Returns an iterator of all the cache names.
|
void |
setCacheProviderForCache(Map<String,String> cacheProviderForCache) |
void |
setCacheProviders(Map<String,CacheProvider> cacheProviders) |
void |
start() |
void |
stop() |
getSettingsBean, setSettingsBeanpublic static final String DEFAULT_CACHE
public void start()
throws JahiaInitializationException
start in class JahiaServiceJahiaInitializationExceptionpublic void stop()
throws JahiaException
stop in class JahiaServiceJahiaExceptionpublic static CacheFactory getInstance()
public <K,V> Cache<K,V> getCache(String name, boolean forceCreation) throws JahiaInitializationException
CacheServiceReturns the requested cache or creates it if it does not exist yet and forceCreation is set to true.
When the name is null the cache creation is canceled and a
null instance will be returned.
getCache in class CacheServicename - the cache regionforceCreation - do we need to create a new cache if it does not exist yet?JahiaInitializationException - when the cache could not be initializedprotected <K,V> Cache<K,V> createCacheInstance(String name, String cacheProvider) throws JahiaInitializationException
JahiaInitializationExceptionpublic Cache getCache(String name)
Retrieves the specified region cache.
getCache in class CacheServicename - the cache region name, null is not allowedpublic Set<String> getNames()
CacheServiceReturns an iterator of all the cache names.
getNames in class CacheServicepublic void flushAllCaches()
CacheServiceFlush all the cache entries of all the registered caches.
Use this method with caution as it may take a lot of CPU time, because the method is synchronized and each accessed cache has to be synchronized too.
flushAllCaches in class CacheServicepublic Map<String,CacheProvider> getCacheProviders()
getCacheProviders in class CacheServicepublic void setCacheProviders(Map<String,CacheProvider> cacheProviders)
setCacheProviders in class CacheServiceCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.