public class CacheService
extends java.lang.Object
DIRECTORY_CACHESERVICE_XML is present in
the "workdirectory" of the DirectoryService then that file will be used for configuring
the CacheManager, if not a default cache configuration file bundled along with
this class is used| Modifier and Type | Field and Description |
|---|---|
private net.sf.ehcache.CacheManager |
cacheManager
the ehcache cache manager
|
private static java.lang.String |
DIRECTORY_CACHESERVICE_XML
The cache configuration file
|
private boolean |
initialized
A flag telling if the cache Service has been intialized
|
private static org.slf4j.Logger |
LOG
The associated logger
|
| Constructor and Description |
|---|
CacheService()
Creates a new instance of CacheService.
|
CacheService(net.sf.ehcache.CacheManager cachemanager)
Creates a new instance of CacheService with the given cache manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Clear the cache and shutdown it
|
net.sf.ehcache.Cache |
getCache(java.lang.String name)
Get a specific cache from its name, or create a new one
|
void |
initialize(InstanceLayout layout)
Initialize the CacheService
|
void |
initialize(InstanceLayout layout,
java.lang.String instanceId)
Initialize the CacheService
|
void |
remove(java.lang.String name)
Remove a cache if it exists.
|
private static final java.lang.String DIRECTORY_CACHESERVICE_XML
private static final org.slf4j.Logger LOG
private net.sf.ehcache.CacheManager cacheManager
private boolean initialized
public CacheService()
public CacheService(net.sf.ehcache.CacheManager cachemanager)
cachemanager - The provided CaxcheManager instancepublic void initialize(InstanceLayout layout)
layout - The place on disk where the cache configuration will be storedpublic void initialize(InstanceLayout layout, java.lang.String instanceId)
layout - The place on disk where the cache configuration will be storedinstanceId - The Instance identifierpublic void destroy()
public net.sf.ehcache.Cache getCache(java.lang.String name)
name - The Cache name we want to retreivepublic void remove(java.lang.String name)
name - The Cache's name we want to remove