public class CmsContainerConfigurationCache extends java.lang.Object implements I_CmsGlobalConfigurationCache
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
INHERITANCE_CONFIG_FILE_NAME
The standard file name for inherited container configurations.
|
static org.apache.commons.logging.Log |
LOG
The logger instance for this class.
|
protected boolean |
m_initialized
A flag which indicates whether this cache is initialized.
|
构造器和说明 |
---|
CmsContainerConfigurationCache(CmsObject cms,
java.lang.String name)
Creates a new cache instance for inherited containers.
|
限定符和类型 | 方法和说明 |
---|---|
void |
clear()
Clears the cache.
|
protected java.lang.String |
getBasePath(java.lang.String rootPath)
Returns the base path for a given configuration file.
|
protected java.lang.String |
getCacheKey(java.lang.String basePath)
Gets the cache key for a given base path.
|
CmsContainerConfiguration |
getContainerConfiguration(java.lang.String rootPath,
java.lang.String name,
java.util.Locale locale)
Gets the container configuration for a given root path, name and locale.
|
void |
initialize()
Initializes the cache.
|
protected boolean |
isContainerConfiguration(java.lang.String rootPath,
int type)
Checks whethet a given combination of path and resource type belongs to an inherited container configuration file.
|
protected void |
load(CmsResource configResource)
Loads a single configuration file into the cache.
|
protected void |
readRemainingConfigurations()
Reads the configurations needed to make the cache up-to-date.
|
void |
remove(CmsPublishedResource resource)
Removes a published resource from the cache.
|
void |
remove(CmsResource resource)
Removes a resource from the cache.
|
protected void |
remove(CmsUUID structureId,
java.lang.String rootPath,
int type)
Removes a resource from the cache.
|
protected int |
safeGetType()
Either gets the configuration type id, or returns -1 if the type hasn't been loaded yet.
|
void |
update(CmsPublishedResource resource)
Updates the cache entry for the given published resource.
|
void |
update(CmsResource resource)
Updates the cache entry for the given resource.
|
protected void |
update(CmsUUID structureId,
java.lang.String rootPath,
int type,
CmsResourceState state)
Updates a resource in the cache.
|
public static final java.lang.String INHERITANCE_CONFIG_FILE_NAME
public static final org.apache.commons.logging.Log LOG
protected boolean m_initialized
public CmsContainerConfigurationCache(CmsObject cms, java.lang.String name) throws CmsException
cms
- the CMS context to use for VFS operations.name
- the name of the cache, for debugging/testing purposesCmsException
- if something goes wrongpublic void clear()
I_CmsGlobalConfigurationCache
public CmsContainerConfiguration getContainerConfiguration(java.lang.String rootPath, java.lang.String name, java.util.Locale locale)
rootPath
- the root pathname
- the configuration namelocale
- the locale to usepublic void initialize()
public void remove(CmsPublishedResource resource)
I_CmsGlobalConfigurationCache
remove
在接口中 I_CmsGlobalConfigurationCache
resource
- the published resourceI_CmsGlobalConfigurationCache.remove(org.opencms.db.CmsPublishedResource)
public void remove(CmsResource resource)
I_CmsGlobalConfigurationCache
remove
在接口中 I_CmsGlobalConfigurationCache
resource
- the resource to removeI_CmsGlobalConfigurationCache.remove(org.opencms.file.CmsResource)
public void update(CmsPublishedResource resource)
I_CmsGlobalConfigurationCache
NOTE: Cache implementations should not directly read the updated resource in this method because it might interfere with other caches. Instead, the resource should be marked as updated and read the next time the cache is queried.
update
在接口中 I_CmsGlobalConfigurationCache
resource
- a published resourceI_CmsGlobalConfigurationCache.update(org.opencms.db.CmsPublishedResource)
public void update(CmsResource resource)
I_CmsGlobalConfigurationCache
NOTE: Cache implementations should not directly read the updated resource in this method because it might interfere with other caches. Instead, the resource should be marked as updated and read the next time the cache is queried.
update
在接口中 I_CmsGlobalConfigurationCache
resource
- the resource for which the cache entry should be updatedI_CmsGlobalConfigurationCache.update(org.opencms.file.CmsResource)
protected java.lang.String getBasePath(java.lang.String rootPath)
rootPath
- the root path of the configuration fileprotected java.lang.String getCacheKey(java.lang.String basePath)
basePath
- the base pathprotected boolean isContainerConfiguration(java.lang.String rootPath, int type)
rootPath
- the root path of the resourcetype
- the type id of the resourceprotected void load(CmsResource configResource)
configResource
- the configuration resourceprotected void readRemainingConfigurations()
protected void remove(CmsUUID structureId, java.lang.String rootPath, int type)
structureId
- the structure id of the resourcerootPath
- the root path of the resourcetype
- the resource typeprotected int safeGetType()
protected void update(CmsUUID structureId, java.lang.String rootPath, int type, CmsResourceState state)
structureId
- the structure id of the resourcerootPath
- the root path of the resourcetype
- the resource typestate
- the resource state