|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
coldbox.system.cache.CacheManager
public class CacheManager
Manages handler,plugin,custom plugin and object caching. It is thread safe and implements locking for you.
| Constructor Summary | |
|---|---|
init(any controller)
Constructor |
|
| Method Summary | |
|---|---|
private boolean |
ThresholdChecks()
JVM Threshold checks |
private void |
announceExpiration(string objectKey)
Announce an Expiration |
void |
clear()
Clears the entire object cache and recreates the object pool and statistics |
void |
clearAllEvents()
Clears all events from the cache |
void |
clearAllViews()
Clears all views from the cache |
void |
clearByKeySnippet(string keySnippet, [boolean regex='false'])
Clears keys using the passed in object key snippet |
void |
clearEvent(string eventsnippet, [string queryString=''])
Clears all the event permutations from the cache according to snippet and querystring |
void |
clearEventMulti(string eventsnippets, [string queryString=''])
Clears all the event permutations from the cache according to the list of snippets and querystrings |
boolean |
clearKey(string objectKey)
Clears an object from the cache by using its cache key |
struct |
clearKeyMulti(string keys, [string prefix=''])
Clears objects from the cache by using its cache key |
void |
clearView(string viewSnippet)
Clears all view name permutations from the cache according to the view name |
void |
configure(CacheConfig cacheConfig)
Configures the cache for operation, sets the configuration object, sets and creates the eviction policy and clears the stats |
void |
expireAll()
Expire All Objects |
void |
expireByKeySnippet(string keySnippet, [boolean regex='false'])
Same as expireKey but can touch multiple objects depending on the keysnippet that is sent in |
void |
expireKey(string objectKey)
Expire an Object |
any |
get(any objectKey)
Get an object from cache |
CacheConfig |
getCacheConfig()
Get the current cache configuration bean |
CacheStats |
getCacheStats()
Return the cache stats object |
struct |
getCachedObjectMetadata(any objectKey)
Get the cached object's metadata structure |
struct |
getCachedObjectMetadataMulti(string keys, [string prefix=''])
Get the cached object's metadata structure |
struct |
getItemTypes()
Get the item types of the cache |
any |
getJavaRuntime()
Get the java runtime object for reporting purposes |
struct |
getMulti(string keys, [string prefix=''])
The returned value is a structure of name-value pairs of all the keys that where found |
any |
getObjectPool()
Get the internal object pool: coldbox |
string |
getPoolKeys()
Get a listing of all the keys of the objects in the cache pool |
struct |
getPoolMetadata([boolean deepCopy='true'])
Get a copy of the pool's metadata structure |
numeric |
getSize()
Get the cache's size in items |
private Util |
getUtil()
Create and return a util object |
EventURLFacade |
geteventURLFacade()
Get the event url facade object |
private void |
initPool()
Initialize and set the internal object Pool |
boolean |
lookup(any objectKey)
Check if an object is in cache, if not found it records a miss |
struct |
lookupMulti(string keys, [string prefix=''])
The returned value is a structure of name-value pairs of all the keys that where found or not |
void |
reap()
Reap the cache |
boolean |
set(any objectKey, any myObject, [any timeout=''], [any lastAccessTimeout=''])
sets an object in cache |
void |
setCacheConfig(CacheConfig CacheConfig)
Set & Override the cache configuration bean |
void |
setEvictionPolicy(AbstractEvictionPolicy evictionPolicy)
You can now override the set eviction policy by programmatically sending it in |
void |
setMulti(struct mapping, [any Timeout=''], [any LastAccessTimeout=''], [string prefix=''])
Sets Multiple Ojects in the cache |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init(any controller)
controller| Method Detail |
|---|
private boolean ThresholdChecks()
private void announceExpiration(string objectKey)
objectKey - The object key to announce expirationpublic void clear()
public void clearAllEvents()
public void clearAllViews()
public void clearByKeySnippet(string keySnippet, [boolean regex='false'])
keySnippet - the cache key snippet to useregex - Use regex or notpublic void clearEvent(string eventsnippet, [string queryString=''])
eventsnippet - The event snippet to clear on. Can be partial or fullqueryString - If passed in, it will create a unique hash out of it. For purging purposespublic void clearEventMulti(string eventsnippets, [string queryString=''])
eventsnippets - The comma-delimmitted list event snippet to clear on. Can be partial or fullqueryString - The comma-delimmitted list of queryStrings passed in. If passed in, it will create a unique hash out of it. For purging purposes. If passed in the list length must be equal to the list length of the event snippets passed in.public boolean clearKey(string objectKey)
objectKey - The key the object was stored under.public struct clearKeyMulti(string keys, [string prefix=''])
keys - The comma-delimmitted list of keys to remove.prefix - A prefix to prepend to the keyspublic void clearView(string viewSnippet)
viewSnippet - The view name snippet to purge from the cachepublic void configure(CacheConfig cacheConfig)
cacheConfig - The configuration objectpublic void expireAll()
public void expireByKeySnippet(string keySnippet, [boolean regex='false'])
keySnippet - The key snippet to useregex - Use regex or notpublic void expireKey(string objectKey)
objectKeypublic any get(any objectKey)
objectKey - The key of the object to lookup.public CacheConfig getCacheConfig()
public CacheStats getCacheStats()
public struct getCachedObjectMetadata(any objectKey)
objectKey - The key of the object to lookup its metadatapublic struct getCachedObjectMetadataMulti(string keys, [string prefix=''])
keys - The comma delimited list of keys to retrieve from the cache.prefix - A prefix to prepend to the keyspublic struct getItemTypes()
public any getJavaRuntime()
public struct getMulti(string keys, [string prefix=''])
keys - The comma delimited list of keys to retrieve from the cache.prefix - A prefix to prepend to the keyspublic any getObjectPool()
public string getPoolKeys()
public struct getPoolMetadata([boolean deepCopy='true'])
deepCopy - Deep copy of structure or by reference. Default is deep copypublic numeric getSize()
private Util getUtil()
public EventURLFacade geteventURLFacade()
private void initPool()
public boolean lookup(any objectKey)
objectKey - The key of the object to lookup.public struct lookupMulti(string keys, [string prefix=''])
keys - The comma delimited list of keys to lookup in the cache.prefix - A prefix to prepend to the keyspublic void reap()
public boolean set(any objectKey, any myObject, [any timeout=''], [any lastAccessTimeout=''])
objectKey - The object cache keymyObject - The object to cachetimeout - Timeout in minutes. If timeout = 0 then object never times out. If timeout is blank, then timeout will be inherited from framework.lastAccessTimeout - Last Access Timeout in minutes. If timeout is blank, then timeout will be inherited from framework.public void setCacheConfig(CacheConfig CacheConfig)
CacheConfigpublic void setEvictionPolicy(AbstractEvictionPolicy evictionPolicy)
evictionPolicypublic void setMulti(struct mapping, [any Timeout=''], [any LastAccessTimeout=''], [string prefix=''])
mapping - The structure of name value pairs to cacheTimeout - Timeout in minutes. If timeout = 0 then object never times out. If timeout is blank, then timeout will be inherited from framework.LastAccessTimeout - Last Access Timeout in minutes. If timeout is blank, then timeout will be inherited from framework.prefix - A prefix to prepend to the keys
|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||