Class CmsMemoryMonitor
- All Implemented Interfaces:
I_CmsScheduledJob
The memory monitor also provides all kind of caches used in the OpenCms core.
- Since:
- 6.0.0
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cacheACL
(String key, CmsAccessControlList acl) Caches the given acl under the given cache key.void
cacheContentDefinition
(String key, CmsXmlContentDefinition contentDefinition) Caches the given content definition under the given cache key.void
cacheGroup
(CmsGroup group) Caches the given group under its id AND fully qualified name.void
cacheLocale
(String key, Locale locale) Caches the given locale under the given cache key.void
Caches the given lock.void
cacheMemObject
(String key, Object obj) Caches the given object under the given cache key.void
cacheOrgUnit
(CmsOrganizationalUnit orgUnit) Caches the given organizational under its id AND the fully qualified name.void
cachePermission
(String key, I_CmsPermissionHandler.CmsPermissionCheckResult permission) Caches the given permission check result under the given cache key.void
cacheProject
(CmsProject project) Caches the given project under its id AND the fully qualified name.void
cacheProjectResources
(String key, List<CmsResource> projectResources) Caches the given project resource list under the given cache key.void
cacheProperty
(String key, CmsProperty property) Caches the given property under the given cache key.void
cachePropertyList
(String key, List<CmsProperty> propertyList) Caches the given property list under the given cache key.void
cachePublishedResources
(String cacheKey, List<CmsPublishedResource> publishedResources) Caches the given published resources list under the given cache key.void
cachePublishJob
(CmsPublishJobInfoBean publishJob) Caches the given publish job.void
cachePublishJobInHistory
(CmsPublishJobInfoBean publishJob) Caches the given publish job in the publish job history.void
cacheResource
(String key, CmsResource resource) Caches the given resource under the given cache key.void
cacheResourceList
(String key, List<CmsResource> resourceList) Caches the given resource list under the given cache key.void
Caches the given value under the given cache key.void
cacheRoleList
(String key, List<CmsRole> roles) Caches the given value under the given cache key.void
Caches the given user under its id AND the fully qualified name.void
cacheUserList
(String key, List<CmsUser> userList) Caches the given list of users under the given cache key.void
cacheVfsObject
(String key, Object obj) Caches the given vfs object under the given cache key.void
cacheXmlPermanentEntity
(String systemId, byte[] content) Caches the given xml entity under the given system id.void
cacheXmlTemporaryEntity
(String key, byte[] content) Caches the given xml entity under the given cache key.void
Clears the access control list cache when access control entries are changed.void
Clears almost all internal caches.void
Clears the caches for publishing.protected void
Clears the OpenCms caches.void
Clears all internal principal-related caches.void
Clears all the depending caches when a resource was changed.void
clearUserCache
(CmsUser user) Clears the user cache for the given user.static <T,
V> Map<T, V> createLRUCacheMap
(int capacity) Creates a thread safe LRU cache map based on the guava cache builder.void
disableCache
(CmsMemoryMonitor.CacheType... types) Disables the given cache.void
enableCache
(CmsMemoryMonitor.CacheType... types) Enables the given cache.boolean
enabled()
Returns if monitoring is enabled.void
Deprecated.void
flushCache
(CmsMemoryMonitor.CacheType... types) Flushes the given cache.void
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
flushLocks
(Map<String, CmsLock> newLocks) Flushes the locks cache.void
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Flushes the user group cache for the user with the given id.void
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadvoid
Deprecated.useflushCache(CacheType[])
insteadReturns all cached lock root paths.Returns all cached locks.Returns all cached publish jobs in the queue as ordered list.Returns all cached publish jobs in the history as ordered list.getCachedACL
(String key) Returns the ACL cached with the given cache key ornull
if not found.Returns the xml content definition cached with the given cache key ornull
if not found.getCachedGroup
(String key) Returns the group cached with the given cache key ornull
if not found.getCachedLocale
(String key) Returns the locale cached with the given cache key ornull
if not found.getCachedLock
(String rootPath) Returns the lock cached with the given root path ornull
if not found.getCachedMemObject
(String key) Returns the memory object cached with the given cache key ornull
if not found.getCachedOrgUnit
(String key) Returns the organizational unit cached with the given cache key ornull
if not found.Returns the permission check result cached with the given cache key ornull
if not found.getCachedProject
(String key) Returns the project cached with the given cache key ornull
if not found.Returns the project resources list cached with the given cache key ornull
if not found.getCachedProperty
(String key) Returns the property cached with the given cache key ornull
if not found.Returns the property list cached with the given cache key ornull
if not found.getCachedPublishedResources
(String cacheKey) Returns the published resources list cached with the given cache key ornull
if not found.Returns the publish job with the given cache key ornull
if not found.Returns the publish job from the history with the given cache key ornull
if not found.getCachedResource
(String key) Returns the resource cached with the given cache key ornull
if not found.Returns the resource list cached with the given cache key ornull
if not found.getCachedRole
(String key) Returns the value cached with the given cache key ornull
if not found.getCachedRoleList
(String key) Returns the value cached with the given cache key ornull
if not found.getCachedUser
(String key) Returns the user cached with the given cache key ornull
if not found.getCachedUserGroups
(CmsUUID userId, String key) Returns the user groups list cached with the given cache key ornull
if not found.getCachedUserList
(String key) Returns the user list cached with the given cache key ornull
if not found.getCachedVfsObject
(String key) Returns the vfs object cached with the given cache key ornull
if not found.byte[]
getCachedXmlPermanentEntity
(String systemId) Returns the xml permanent entity content cached with the given systemId ornull
if not found.byte[]
Returns the xml temporary entity content cached with the given cache key ornull
if not found.Returns the configuration.protected long
Returns the cache costs of a monitored object.Returns the next publish job from the publish job queue.Gets the group list cache.protected String
Returns the number of items within a monitored object.protected long
getKeySize
(Object obj) Returns the total size of key strings within a monitored object.protected long
getKeySize
(Map<?, ?> map, int depth) Returns the total size of key strings within a monitored map.protected String
Returns the max costs for all items within a monitored object.int
Returns the log count.static int
getMemorySize
(Object obj) Returns the size of objects that are instances ofbyte[]
,String
,CmsFile
,I_CmsLruCacheObject
.Returns the current memory status.com.google.common.cache.LoadingCache<CmsDriverManager.ResourceOUCacheKey,
CmsDriverManager.ResourceOUMap> Gets the cache for OU / resource associations.static long
getValueSize
(Object obj) Returns the value sizes of value objects within the monitored object.static long
getValueSize
(List<?> listValue, int depth) Returns the total value size of a list object.static long
getValueSize
(Map<?, ?> mapValue, int depth) Returns the total value size of a map object.void
initialize
(CmsSystemConfiguration configuration) Initializes the monitor with the provided configuration.boolean
Deprecated.useisEnabled(CacheType)
insteadboolean
Deprecated.useisEnabled(CacheType)
insteadboolean
Deprecated.useisEnabled(CacheType)
insteadboolean
Deprecated.useisEnabled(CacheType)
insteadboolean
Checks if the given cache is enabled.boolean
isMonitoring
(String key) Checks if there is a registered monitored object with the given key.This method will be called when this scheduled job is executed.boolean
Returns true if the system runs low on memory.protected void
monitorSendEmail
(boolean warning) Sends a warning or status email with OpenCms Memory information.protected void
monitorWriteLog
(boolean warning) Write a warning or status log entry with OpenCms Memory information.void
Adds a new object to the monitor.boolean
Checks if some kind of persistence is required.void
setCacheProperty
(boolean cacheProperty) Deprecated.useenableCache(CacheType[])
ordisableCache(CacheType[])
insteadvoid
setCachePropertyList
(boolean cachePropertyList) Deprecated.useenableCache(CacheType[])
ordisableCache(CacheType[])
insteadvoid
setCacheResource
(boolean cacheResource) Deprecated.useenableCache(CacheType[])
ordisableCache(CacheType[])
insteadvoid
setCacheResourceList
(boolean cacheResourceList) Deprecated.useenableCache(CacheType[])
ordisableCache(CacheType[])
insteadvoid
shutdown()
Flushes all cached objects.void
Removes the given xml content definition from the cache.void
uncacheGroup
(CmsGroup group) Removes the given group from the cache.void
uncacheLock
(String rootPath) Removes the cached lock for the given root path from the cache.void
uncacheOrgUnit
(CmsOrganizationalUnit orgUnit) Removes the given organizational unit from the cache.void
uncacheProject
(CmsProject project) Removes the given project from the cache.void
uncachePublishJob
(CmsPublishJobInfoBean publishJob) Removes the given publish job from the cache.void
uncachePublishJobInHistory
(CmsPublishJobInfoBean publishJob) Removes the given publish job from the history.void
uncacheUser
(CmsUser user) Removes the given user from the cache.void
uncacheVfsObject
(String key) Removes the given vfs object from the cache.void
Removes the given xml temporary entity from the cache.protected void
Updates the memory information of the memory monitor.
-
Constructor Details
-
CmsMemoryMonitor
public CmsMemoryMonitor()Empty constructor, required by OpenCms scheduler.
-
-
Method Details
-
createLRUCacheMap
Creates a thread safe LRU cache map based on the guava cache builder.Use this instead of synchronized maps for better performance.
- Parameters:
capacity
- the cache capacity- Returns:
- the cache map
-
getMemorySize
Returns the size of objects that are instances ofbyte[]
,String
,CmsFile
,I_CmsLruCacheObject
.For other objects, a size of 0 is returned.
- Parameters:
obj
- the object- Returns:
- the size of the object
-
getValueSize
Returns the total value size of a list object.- Parameters:
listValue
- the list objectdepth
- the max recursion depth for calculation the size- Returns:
- the size of the list object
-
getValueSize
Returns the total value size of a map object.- Parameters:
mapValue
- the map objectdepth
- the max recursion depth for calculation the size- Returns:
- the size of the map object
-
getValueSize
Returns the value sizes of value objects within the monitored object.- Parameters:
obj
- the object- Returns:
- the value sizes of value objects or "-"-fields
-
cacheACL
Caches the given acl under the given cache key.- Parameters:
key
- the cache keyacl
- the acl to cache
-
cacheContentDefinition
Caches the given content definition under the given cache key.- Parameters:
key
- the cache keycontentDefinition
- the content definition to cache
-
cacheGroup
Caches the given group under its id AND fully qualified name.- Parameters:
group
- the group to cache
-
cacheLocale
Caches the given locale under the given cache key.- Parameters:
key
- the cache keylocale
- the locale to cache
-
cacheLock
Caches the given lock.The lock is cached by it resource's root path.
- Parameters:
lock
- the lock to cache
-
cacheMemObject
Caches the given object under the given cache key.- Parameters:
key
- the cache keyobj
- the object to cache
-
cacheOrgUnit
Caches the given organizational under its id AND the fully qualified name.- Parameters:
orgUnit
- the organizational unit to cache
-
cachePermission
Caches the given permission check result under the given cache key.- Parameters:
key
- the cache keypermission
- the permission check result to cache
-
cacheProject
Caches the given project under its id AND the fully qualified name.- Parameters:
project
- the project to cache
-
cacheProjectResources
Caches the given project resource list under the given cache key.- Parameters:
key
- the cache keyprojectResources
- the project resources to cache
-
cacheProperty
Caches the given property under the given cache key.- Parameters:
key
- the cache keyproperty
- the property to cache
-
cachePropertyList
Caches the given property list under the given cache key.- Parameters:
key
- the cache keypropertyList
- the property list to cache
-
cachePublishedResources
Caches the given published resources list under the given cache key.- Parameters:
cacheKey
- the cache keypublishedResources
- the published resources list to cache
-
cachePublishJob
Caches the given publish job.- Parameters:
publishJob
- the publish job
-
cachePublishJobInHistory
Caches the given publish job in the publish job history.- Parameters:
publishJob
- the publish job
-
cacheResource
Caches the given resource under the given cache key.- Parameters:
key
- the cache keyresource
- the resource to cache
-
cacheResourceList
Caches the given resource list under the given cache key.- Parameters:
key
- the cache keyresourceList
- the resource list to cache
-
cacheRole
Caches the given value under the given cache key.- Parameters:
key
- the cache keyhasRole
- if the user has the given role
-
cacheRoleList
Caches the given value under the given cache key.- Parameters:
key
- the cache keyroles
- the roles of the user
-
cacheUser
Caches the given user under its id AND the fully qualified name.- Parameters:
user
- the user to cache
-
cacheUserList
Caches the given list of users under the given cache key.- Parameters:
key
- the cache keyuserList
- the list of users to cache
-
cacheVfsObject
Caches the given vfs object under the given cache key.- Parameters:
key
- the cache keyobj
- the vfs object to cache
-
cacheXmlPermanentEntity
Caches the given xml entity under the given system id.- Parameters:
systemId
- the cache keycontent
- the content to cache
-
cacheXmlTemporaryEntity
Caches the given xml entity under the given cache key.- Parameters:
key
- the cache keycontent
- the content to cache
-
clearAccessControlListCache
Clears the access control list cache when access control entries are changed. -
clearCache
Clears almost all internal caches. -
clearCacheForPublishing
Clears the caches for publishing. -
clearPrincipalsCache
Clears all internal principal-related caches. -
clearResourceCache
Clears all the depending caches when a resource was changed. -
clearUserCache
Clears the user cache for the given user.- Parameters:
user
- the user
-
disableCache
Disables the given cache.- Parameters:
types
- the cache type to disable
-
enableCache
Enables the given cache.- Parameters:
types
- the cache type to disable
-
enabled
Returns if monitoring is enabled.- Returns:
- true if monitoring is enabled
-
flushACLs
Deprecated.useflushCache(CacheType[])
insteadFlushes the ACL cache. -
flushCache
Flushes the given cache.- Parameters:
types
- the cache types to flush
-
flushContentDefinitions
Deprecated.useflushCache(CacheType[])
insteadFlushes the xml content definitions cache. -
flushGroups
Deprecated.useflushCache(CacheType[])
insteadFlushes the group cache. -
flushLocales
Deprecated.useflushCache(CacheType[])
insteadFlushes the locale cache. -
flushLocks
Flushes the locks cache.- Parameters:
newLocks
- if notnull
the lock cache is replaced by the given map
-
flushMemObjects
Deprecated.useflushCache(CacheType[])
insteadFlushes the memory object cache. -
flushOrgUnits
Deprecated.useflushCache(CacheType[])
insteadFlushes the organizational unit cache. -
flushPermissions
Deprecated.useflushCache(CacheType[])
insteadFlushes the permission check result cache. -
flushProjectResources
Deprecated.useflushCache(CacheType[])
insteadFlushes the project resources cache. -
flushProjects
Deprecated.useflushCache(CacheType[])
insteadFlushes the project cache. -
flushProperties
Deprecated.useflushCache(CacheType[])
insteadFlushes the property cache. -
flushPropertyLists
Deprecated.useflushCache(CacheType[])
insteadFlushes the property list cache. -
flushPublishedResources
Deprecated.useflushCache(CacheType[])
insteadFlushes the published resources cache. -
flushPublishJobHistory
Deprecated.useflushCache(CacheType[])
insteadFlushes the publish history. -
flushPublishJobs
Deprecated.useflushCache(CacheType[])
insteadFlushes the publish queue. -
flushResourceLists
Deprecated.useflushCache(CacheType[])
insteadFlushes the resource list cache. -
flushResources
Deprecated.useflushCache(CacheType[])
insteadFlushes the resource cache. -
flushRoleLists
Deprecated.useflushCache(CacheType[])
insteadFlushes the role lists cache. -
flushRoles
Deprecated.useflushCache(CacheType[])
insteadFlushes the roles cache. -
flushUserGroups
Deprecated.useflushCache(CacheType[])
insteadFlushes the user groups cache. -
flushUserGroups
Flushes the user group cache for the user with the given id.- Parameters:
id
- the user id
-
flushUsers
Deprecated.useflushCache(CacheType[])
insteadFlushes the users cache. -
flushVfsObjects
Deprecated.useflushCache(CacheType[])
insteadFlushes the vfs object cache. -
flushXmlPermanentEntities
Deprecated.useflushCache(CacheType[])
insteadFlushes the xml permanent entities cache. -
flushXmlTemporaryEntities
Deprecated.useflushCache(CacheType[])
insteadFlushes the xml temporary entities cache. -
getAllCachedLockPaths
Returns all cached lock root paths.- Returns:
- a list of
String
objects
-
getAllCachedLocks
Returns all cached locks.- Returns:
- a list of
CmsLock
objects
-
getAllCachedPublishJobs
Returns all cached publish jobs in the queue as ordered list.- Returns:
- all cached publish jobs
-
getAllCachedPublishJobsInHistory
Returns all cached publish jobs in the history as ordered list.- Returns:
- all cached publish jobs
-
getCachedACL
Returns the ACL cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the ACL cached with the given cache key
-
getCachedContentDefinition
Returns the xml content definition cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the xml content definition cached with the given cache key
-
getCachedGroup
Returns the group cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for, this may be the group's uuid or the fqn- Returns:
- the group cached with the given cache key
-
getCachedLocale
Returns the locale cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the locale cached with the given cache key
-
getCachedLock
Returns the lock cached with the given root path ornull
if not found.- Parameters:
rootPath
- the root path to look for- Returns:
- the lock cached with the given root path
-
getCachedMemObject
Returns the memory object cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the memory object cached with the given cache key
-
getCachedOrgUnit
Returns the organizational unit cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for, this may be the organizational unit's uuid or the fqn- Returns:
- the organizational unit cached with the given cache key
-
getCachedPermission
Returns the permission check result cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the permission check result cached with the given cache key
-
getCachedProject
Returns the project cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for, this may be the project's uuid or the fqn- Returns:
- the project cached with the given cache key
-
getCachedProjectResources
Returns the project resources list cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the project resources list cached with the given cache key
-
getCachedProperty
Returns the property cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the property cached with the given cache key
-
getCachedPropertyList
Returns the property list cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the property list cached with the given cache key
-
getCachedPublishedResources
Returns the published resources list cached with the given cache key ornull
if not found.- Parameters:
cacheKey
- the cache key to look for- Returns:
- the published resources list cached with the given cache key
-
getCachedPublishJob
Returns the publish job with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the publish job with the given cache key
-
getCachedPublishJobInHistory
Returns the publish job from the history with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the publish job with the given cache key
-
getCachedResource
Returns the resource cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the resource cached with the given cache key
-
getCachedResourceList
Returns the resource list cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the resource list cached with the given cache key
-
getCachedRole
Returns the value cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- if the user has the given role
-
getCachedRoleList
Returns the value cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- list of roles
-
getCachedUser
Returns the user cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for, this may be the user's uuid or the fqn- Returns:
- the user cached with the given cache key
-
getCachedUserGroups
Returns the user groups list cached with the given cache key ornull
if not found.- Parameters:
userId
- the user idkey
- the cache key to look for- Returns:
- the user groups list cached with the given cache key
-
getCachedUserList
Returns the user list cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the user groups list cached with the given cache key
-
getCachedVfsObject
Returns the vfs object cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the vfs object cached with the given cache key
-
getCachedXmlPermanentEntity
Returns the xml permanent entity content cached with the given systemId ornull
if not found.- Parameters:
systemId
- the cache key to look for- Returns:
- the xml permanent entity content cached with the given cache key
-
getCachedXmlTemporaryEntity
Returns the xml temporary entity content cached with the given cache key ornull
if not found.- Parameters:
key
- the cache key to look for- Returns:
- the xml temporary entity content cached with the given cache key
-
getConfiguration
Returns the configuration.- Returns:
- the configuration
-
getFirstCachedPublishJob
Returns the next publish job from the publish job queue.- Returns:
- the next publish job
-
getGroupListCache
Gets the group list cache.- Returns:
- the group list cache
-
getLogCount
Returns the log count.- Returns:
- the log count
-
getMemoryStatus
Returns the current memory status.- Returns:
- the memory status
-
getResourceOuCache
public com.google.common.cache.LoadingCache<CmsDriverManager.ResourceOUCacheKey,CmsDriverManager.ResourceOUMap> getResourceOuCache()Gets the cache for OU / resource associations.- Returns:
- the cache
-
initialize
Initializes the monitor with the provided configuration.- Parameters:
configuration
- the configuration to use
-
isCacheProperty
Deprecated.useisEnabled(CacheType)
insteadChecks if the property cache is enabled.- Returns:
true
if the property cache is enabled
-
isCachePropertyList
Deprecated.useisEnabled(CacheType)
insteadChecks if the property list cache is enabled.- Returns:
true
if the property list cache is enabled
-
isCacheResource
Deprecated.useisEnabled(CacheType)
insteadChecks if the resource cache is enabled.- Returns:
true
if the resource cache is enabled
-
isCacheResourceList
Deprecated.useisEnabled(CacheType)
insteadChecks if the resource list cache is enabled.- Returns:
true
if the resource list cache is enabled
-
isEnabled
Checks if the given cache is enabled.- Parameters:
type
- the cache type to check- Returns:
true
if the given cache is enabled
-
isMonitoring
Checks if there is a registered monitored object with the given key.- Parameters:
key
- the key to look for- Returns:
true
if there is a registered monitored object with the given key
-
launch
Description copied from interface:I_CmsScheduledJob
This method will be called when this scheduled job is executed.Depending on the configuration of this job, a new instance of the configured class will be instantiated every time the job is launched, or a new instance will be generated only the first time the job is launched, and re-used afterwards.
The result String will be written to the OpenCms logfile in the
org.opencms.scheduler.CmsScheduleManager
channel, onINFO
log level.- Specified by:
launch
in interfaceI_CmsScheduledJob
- Parameters:
cms
- will be initialized with the configured users cms contextparameters
- the configured parameters- Returns:
- a String that will be written to the OpenCms logfile
- Throws:
Exception
- if something goes wrong- See Also:
-
lowMemory
Returns true if the system runs low on memory.- Returns:
- true if the system runs low on memory
-
register
Adds a new object to the monitor.- Parameters:
objectName
- name of the objectobject
- the object for monitoring
-
requiresPersistency
Checks if some kind of persistence is required.This could be overwritten in a distributed environment.
- Returns:
true
if some kind of persistence is required
-
setCacheProperty
Deprecated.useenableCache(CacheType[])
ordisableCache(CacheType[])
insteadSets if the property cache is enabled.- Parameters:
cacheProperty
- if the property cache is enabled
-
setCachePropertyList
Deprecated.useenableCache(CacheType[])
ordisableCache(CacheType[])
insteadSets if the property list cache is enabled.- Parameters:
cachePropertyList
- if the property list cache is enabled
-
setCacheResource
Deprecated.useenableCache(CacheType[])
ordisableCache(CacheType[])
insteadSets if the resource cache is enabled.- Parameters:
cacheResource
- if the resource cache is enabled
-
setCacheResourceList
Deprecated.useenableCache(CacheType[])
ordisableCache(CacheType[])
insteadSets if the resource list cache is enabled.- Parameters:
cacheResourceList
- if the resource list cache is enabled
-
shutdown
Flushes all cached objects.- Throws:
Exception
- if something goes wrong
-
uncacheContentDefinition
Removes the given xml content definition from the cache.- Parameters:
key
- the cache key to remove from cache
-
uncacheGroup
Removes the given group from the cache.The group is removed by name AND also by uuid.
- Parameters:
group
- the group to remove from cache
-
uncacheLock
Removes the cached lock for the given root path from the cache.- Parameters:
rootPath
- the root path of the lock to remove from cache
-
uncacheOrgUnit
Removes the given organizational unit from the cache.The organizational unit is removed by name AND also by uuid.
- Parameters:
orgUnit
- the organizational unit to remove from cache
-
uncacheProject
Removes the given project from the cache.The project is removed by name AND also by uuid.
- Parameters:
project
- the project to remove from cache
-
uncachePublishJob
Removes the given publish job from the cache.- Parameters:
publishJob
- the publish job to remove
-
uncachePublishJobInHistory
Removes the given publish job from the history.- Parameters:
publishJob
- the publish job to remove
-
uncacheUser
Removes the given user from the cache.The user is removed by name AND also by uuid.
- Parameters:
user
- the user to remove from cache
-
uncacheVfsObject
Removes the given vfs object from the cache.- Parameters:
key
- the cache key to remove from cache
-
uncacheXmlTemporaryEntity
Removes the given xml temporary entity from the cache.- Parameters:
key
- the cache key to remove from cache
-
clearCaches
Clears the OpenCms caches. -
getCosts
Returns the cache costs of a monitored object.obj
must be of typeCmsLruCache
.- Parameters:
obj
- the object- Returns:
- the cache costs or "-"
-
getItems
Returns the number of items within a monitored object.obj
must be of typeCmsLruCache
orMap
.- Parameters:
obj
- the object- Returns:
- the number of items or "-"
-
getKeySize
Returns the total size of key strings within a monitored map.The keys must be of type
String
.- Parameters:
map
- the mapdepth
- the max recursion depth for calculation the size- Returns:
- total size of key strings
-
getKeySize
Returns the total size of key strings within a monitored object.- Parameters:
obj
- the object- Returns:
- the total size of key strings
-
getLimit
Returns the max costs for all items within a monitored object.obj
must be of typeCmsLruCache
orLRUMap
.- Parameters:
obj
- the object- Returns:
- max cost limit or "-"
-
monitorSendEmail
Sends a warning or status email with OpenCms Memory information.- Parameters:
warning
- if true, send a memory warning email
-
monitorWriteLog
Write a warning or status log entry with OpenCms Memory information.- Parameters:
warning
- if true, write a memory warning log entry
-
updateStatus
Updates the memory information of the memory monitor.
-
flushCache(CacheType[])
instead