public class CmsVfsMemoryObjectCache extends CmsVfsCache
EVENT_BEFORE_PUBLISH_PROJECT, EVENT_CLEAR_CACHES, EVENT_CLEAR_OFFLINE_CACHES, EVENT_CLEAR_ONLINE_CACHES, EVENT_CLEAR_PRINCIPAL_CACHES, EVENT_FLEX_CACHE_CLEAR, EVENT_FLEX_PURGE_JSP_REPOSITORY, EVENT_FULLSTATIC_EXPORT, EVENT_GROUP_MODIFIED, EVENT_LOGIN_USER, EVENT_OU_MODIFIED, EVENT_PROJECT_MODIFIED, EVENT_PROPERTY_DEFINITION_CREATED, EVENT_PROPERTY_DEFINITION_MODIFIED, EVENT_PROPERTY_MODIFIED, EVENT_PUBLISH_PROJECT, EVENT_REBUILD_SEARCHINDEXES, EVENT_RESOURCE_AND_PROPERTIES_MODIFIED, EVENT_RESOURCE_COPIED, EVENT_RESOURCE_CREATED, EVENT_RESOURCE_DELETED, EVENT_RESOURCE_MODIFIED, EVENT_RESOURCE_MOVED, EVENT_RESOURCES_AND_PROPERTIES_MODIFIED, EVENT_RESOURCES_MODIFIED, EVENT_SITEMAP_CHANGED, EVENT_UPDATE_EXPORTS, EVENT_USER_MODIFIED, KEY_CHANGE, KEY_DBCONTEXT, KEY_GROUP_ID, KEY_GROUP_NAME, KEY_INDEX_NAMES, KEY_OU_ID, KEY_OU_NAME, KEY_PROJECTID, KEY_PUBLISHID, KEY_PUBLISHLIST, KEY_REPORT, KEY_RESOURCE, KEY_RESOURCES, KEY_USER_ACTION, KEY_USER_ID, KEY_USER_NAME, LISTENERS_FOR_ALL_EVENTS, VALUE_GROUP_MODIFIED_ACTION_CREATE, VALUE_GROUP_MODIFIED_ACTION_DELETE, VALUE_GROUP_MODIFIED_ACTION_WRITE, VALUE_OU_MODIFIED_ACTION_CREATE, VALUE_OU_MODIFIED_ACTION_DELETE, VALUE_USER_MODIFIED_ACTION_ADD_USER_TO_GROUP, VALUE_USER_MODIFIED_ACTION_CREATE_USER, VALUE_USER_MODIFIED_ACTION_DELETE_USER, VALUE_USER_MODIFIED_ACTION_REMOVE_USER_FROM_GROUP, VALUE_USER_MODIFIED_ACTION_RESET_PASSWORD, VALUE_USER_MODIFIED_ACTION_SET_OU, VALUE_USER_MODIFIED_ACTION_WRITE_USER
Constructor and Description |
---|
CmsVfsMemoryObjectCache()
Constructor, creates a new CmsVfsMemoryObjectCache.
|
Modifier and Type | Method and Description |
---|---|
protected void |
flush(boolean online)
Flushes the caches.
|
java.lang.Object |
getCachedObject(CmsObject cms,
java.lang.String rootPath)
Return an object from the cache.
|
static CmsVfsMemoryObjectCache |
getVfsMemoryObjectCache()
Returns the VFS memory Object cache.
|
java.lang.Object |
loadVfsObject(CmsObject cms,
java.lang.String rootPath,
org.apache.commons.collections.Transformer function)
Uses a transformer for loading an object from a path if it has not already been cached, and then caches it.
|
void |
putCachedObject(CmsObject cms,
java.lang.String rootPath,
java.lang.Object value)
Puts an object into the cache.
|
protected void |
uncacheResource(CmsResource resource)
Removes a cached resource from the cache.
|
cmsEvent, registerEventListener, shutdown, uncacheResources
public CmsVfsMemoryObjectCache()
public static CmsVfsMemoryObjectCache getVfsMemoryObjectCache()
public java.lang.Object getCachedObject(CmsObject cms, java.lang.String rootPath)
cms
- the current users OpenCms contextrootPath
- the rootPath of the VFS resource to get the object forpublic java.lang.Object loadVfsObject(CmsObject cms, java.lang.String rootPath, org.apache.commons.collections.Transformer function)
cms
- the CMS contextrootPath
- the root path from which the object should be loadedfunction
- the function which should load the object from VFS if it isn't already cachedpublic void putCachedObject(CmsObject cms, java.lang.String rootPath, java.lang.Object value)
cms
- the CmsObjectrootPath
- the rootPath of the VFS resource to store the object forvalue
- the object to storeprotected void flush(boolean online)
CmsVfsCache
flush
in class CmsVfsCache
online
- if to flush the online or offline cachesCmsVfsCache.flush(boolean)
protected void uncacheResource(CmsResource resource)
CmsVfsCache
uncacheResource
in class CmsVfsCache
resource
- the resourceCmsVfsCache.uncacheResource(org.opencms.file.CmsResource)