public class CacheLoaderManager extends Object
CacheLoaderConfig object.
Usage:
CacheLoaderManager manager = new CacheLoaderManager();
manager.setConfig(myXmlSnippet, myTreeCache);
CacheLoader loader = manager.getCacheLoader();
The XML configuration passed in would typically look like:
false
/
org.jboss.cache.loader.FileCacheLoader
true
false
false
location=/tmp/file
]]>
| Constructor and Description |
|---|
CacheLoaderManager() |
| Modifier and Type | Method and Description |
|---|---|
CacheLoader |
getCacheLoader()
Returns the cache loader
|
CacheLoaderConfig |
getCacheLoaderConfig()
Returns the configuration element of the cache loaders
|
void |
injectDependencies(CacheSPI cache,
Configuration configuration,
RegionManager regionManager,
ComponentRegistry registry) |
boolean |
isFetchPersistentState()
Returns true if at least one of the configured cache loaders has set fetchPersistentState to true.
|
boolean |
isPassivation()
Tests if we're using passivation
|
void |
preload(Fqn fqn,
boolean preloadParents,
boolean preloadChildren)
Preloads a specific Fqn into the cache from the configured cacheloader
|
void |
preloadCache()
Performs a preload on the cache based on the cache loader preload configs used when configuring the cache.
|
void |
purgeLoaders(boolean force) |
protected void |
setCacheInLoader(CacheSPI c,
CacheLoader loader)
Sets the cache instance associated with the given cache loader.
|
void |
setConfig(CacheLoaderConfig config,
CacheSPI cache,
Configuration configuration)
Sets a configuration object and creates a cacheloader accordingly.
|
void |
startCacheLoader() |
void |
stopCacheLoader() |
public void injectDependencies(CacheSPI cache, Configuration configuration, RegionManager regionManager, ComponentRegistry registry)
public void setConfig(CacheLoaderConfig config, CacheSPI cache, Configuration configuration) throws CacheException
config - cache - CacheExceptionprotected void setCacheInLoader(CacheSPI c, CacheLoader loader)
c - instance of cache to be set in cache loaderloader - cache loader to which assign the cache instancepublic void preloadCache()
throws CacheException
ExceptionCacheExceptionpublic void preload(Fqn fqn, boolean preloadParents, boolean preloadChildren) throws CacheException
fqn - fqn to preloadpreloadParents - whether we preload parentspreloadChildren - whether we preload childrenCacheException - if we are unable to preloadpublic CacheLoaderConfig getCacheLoaderConfig()
public CacheLoader getCacheLoader()
public boolean isPassivation()
public boolean isFetchPersistentState()
public void stopCacheLoader()
public void startCacheLoader()
throws CacheException
CacheExceptionCopyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.