lucee.Component cachebox.system.cache.AbstractCacheBoxProvider cachebox.system.cache.providers.CacheBoxProvider
The coolest standalone CacheBox Provider ever built
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
void
|
_reap()
Reap the cache, clear out everything that is dead. |
private void
|
announceExpiration(any objectKey)
Announce an Expiration. |
any
|
clear(any objectKey)
Clears an object from the cache by using its cache key. |
void
|
clearAll()
Clear all the cache elements from the cache. |
void
|
clearByKeySnippet(any keySnippet, [any regex='false'], [any async='false'])
Clears keys using the passed in object key snippet. |
any
|
clearKey(any objectKey)
Deprecated, please use clear(). |
any
|
clearMulti(any keys, [any prefix=''])
Clears objects from the cache by using its cache key. |
any
|
clearQuiet(any objectKey)
Clears an object from the cache by using its cache key. |
void
|
configure()
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(any keySnippet, [any regex='false'])
Same as expireKey but can touch multiple objects depending on the keysnippet that is sent in. |
void
|
expireObject(any objectKey)
Expire an Object. |
any
|
get(any objectKey)
Get an object from cache. |
any
|
getCachedObjectMetadata(any objectKey)
Get the cached object's metadata structure. |
any
|
getCachedObjectMetadataMulti(any keys, [any prefix=''])
Get the cached object's metadata structure. |
any
|
getJavaRuntime()
Get the java runtime object for reporting purposes. |
any
|
getKeys()
Get a listing of all the keys of the objects in the cache. |
any
|
getMulti(any keys, [any prefix=''])
The returned value is a structure of name-value pairs of all the keys that where found. |
any<IObjectStore>
|
getObjectStore()
If the cache provider implements it, this returns the cache's object store as type: cachebox. |
any
|
getOrSet(any objectKey, any produce, [any timeout=''], [any lastAccessTimeout=''], [any extra='[runtime expression]'])
Tries to get an object from the cache, if not found, it calls the 'produce' closure to produce the data and cache it. |
any
|
getQuiet(any objectKey)
Get an object from cache. |
any
|
getSize()
Get the cache's size in items. |
any
|
getStoreMetadataKeyMap()
Get a key lookup structure where cachebox can build the report on. |
any
|
getStoreMetadataReport()
Get a structure of all the keys in the cache with their appropriate metadata structures. |
any
|
isExpired(any objectKey)
Has the object key expired in the cache. |
private any
|
locateEvictionPolicy([string policy])
Locate the eviction policy. |
private any
|
locateObjectStore([string store])
Locate the object store. |
any
|
lookup(any objectKey)
Check if an object is in cache, if not found it records a miss. |
any
|
lookupMulti(any keys, [any prefix=''])
The returned value is a structure of name-value pairs of all the keys that where found or not. |
any
|
lookupQuiet(any objectKey)
Check if an object is in cache quietly, advising nobody!. |
void
|
reap()
Reap the cache, clear out everything that is dead. |
any
|
set(any objectKey, any object, [any timeout=''], [any lastAccessTimeout=''], [any extra])
sets an object in cache. |
void
|
setMulti(any mapping, [any timeout=''], [any lastAccessTimeout=''], [any prefix=''])
Sets Multiple Ojects in the cache. |
any
|
setQuiet(any objectKey, any object, [any timeout=''], [any lastAccessTimeout=''], [any extra])
sets an object in cache. |
void
|
shutdown()
Shutdown command issued when CacheBox is going through shutdown phase. |
private boolean
|
thresholdChecks(any threshold='')
JVM Threshold checks. |
private void
|
validateConfiguration()
Validate incoming set configuration data. |
Methods inherited from class cachebox.system.cache.AbstractCacheBoxProvider |
---|
clearStatistics, getCacheFactory, getCacheID, getConfiguration, getEventManager, getMemento, getName, getStats, getUtil, isEnabled, isReportingEnabled, setCacheFactory, setConfiguration, setEventManager, setName, statusCheck |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Method Detail |
---|
Reap the cache, clear out everything that is dead.
Announce an Expiration
objectKey
- The object cache keyClears an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore
clear
in interface
ICacheProvider
objectKey
- The object cache keyClear all the cache elements from the cache
clearAll
in interface
ICacheProvider
Clears keys using the passed in object key snippet
keySnippet
- the cache key snippet to useregex
- Use regex or notasync
- Run command asynchronously or notDeprecated, please use clear()
objectKey
- The object cache keyClears objects from the cache by using its cache key. The returned value is a structure of name-value pairs of all the keys that where removed from the operation.
keys
- The comma-delimmitted list or array of keys to remove.prefix
- A prefix to prepend to the keysClears an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore
clearQuiet
in interface
ICacheProvider
objectKey
- The object cache keyConfigures the cache for operation, sets the configuration object, sets and creates the eviction policy and clears the stats. If this method is not called, the cache is useless.
configure
in interface
ICacheProvider
Expire All Objects. Use this instead of clear() from within handlers or any cached object, this sets the metadata for the objects to expire in the next request. Note that this is not an inmmediate expiration. Clear should only be used from outside a cached object
expireAll
in interface
ICacheProvider
Same as expireKey but can touch multiple objects depending on the keysnippet that is sent in.
keySnippet
- The key snippet to useregex
- Use regex or notExpire an Object. Use this instead of clearKey() from within handlers or any cached object, this sets the metadata for the objects to expire in the next request. Note that this is not an inmmediate expiration. Clear should only be used from outside a cached object
expireObject
in interface
ICacheProvider
objectKey
- The object cache keyGet an object from cache. If object does not exist it returns null
get
in interface
ICacheProvider
objectKey
- The key of the object to lookup.Get the cached object's metadata structure. If the object does not exist, it returns an empty structure.
getCachedObjectMetadata
in interface
ICacheProvider
objectKey
- The key of the object to lookup its metadataGet the cached object's metadata structure. If the object does not exist, it returns an empty structure.
keys
- The comma delimited list or array of keys to retrieve from the cache.prefix
- A prefix to prepend to the keysGet the java runtime object for reporting purposes.
Get a listing of all the keys of the objects in the cache
getKeys
in interface
ICacheProvider
The returned value is a structure of name-value pairs of all the keys that where found. Not found values will not be returned
keys
- The comma delimited list or array of keys to retrieve from the cache.prefix
- A prefix to prepend to the keysIf the cache provider implements it, this returns the cache's object store as type: cachebox.system.cache.store.IObjectStore
getObjectStore
in interface
ICacheProvider
Tries to get an object from the cache, if not found, it calls the 'produce' closure to produce the data and cache it.
objectKey
- The object cache keyproduce
- The closure/udf to produce the data if not foundtimeout
- The timeout to use on the object (if any, provider specific)lastAccessTimeout
- The idle timeout to use on the object (if any, provider specific)extra
- A map of name-value pairs to use as extra arguments to pass to a providers set operationGet an object from cache. If object does not exist it returns null
getQuiet
in interface
ICacheProvider
objectKey
- The key of the object to lookup.Get the cache's size in items
getSize
in interface
ICacheProvider
Get a key lookup structure where cachebox can build the report on. Ex: [timeout=timeout,lastAccessTimeout=idleTimeout]. It is a way for the visualizer to construct the columns correctly on the reports
getStoreMetadataKeyMap
in interface
ICacheProvider
Get a structure of all the keys in the cache with their appropriate metadata structures. This is used to build the reporting.[keyX->[metadataStructure]]
getStoreMetadataReport
in interface
ICacheProvider
Has the object key expired in the cache
isExpired
in interface
ICacheProvider
objectKey
- The object keyLocate the eviction policy
policy
Locate the object store
store
Check if an object is in cache, if not found it records a miss.
lookup
in interface
ICacheProvider
objectKey
- The key of the object to lookup.The returned value is a structure of name-value pairs of all the keys that where found or not.
keys
- The comma delimited list or an array of keys to lookup in the cache.prefix
- A prefix to prepend to the keysCheck if an object is in cache quietly, advising nobody!
lookupQuiet
in interface
ICacheProvider
objectKey
- The key of the object to lookup.Reap the cache, clear out everything that is dead.
reap
in interface
ICacheProvider
sets an object in cache. Sets might be expensive. If the JVM threshold is used and it has been reached, the object won't be cached. If the pool is at maximum it will expire using its eviction policy and still cache the object. Cleanup will be done later.
set
in interface
ICacheProvider
objectKey
- The object cache keyobject
- The object to cachetimeout
- The timeout to use on the object (if any, provider specific)lastAccessTimeout
- The idle timeout to use on the object (if any, provider specific)extra
- A map of name-value pairs to use as extra arguments to pass to a providers set operationSets Multiple Ojects in the cache. Sets might be expensive. If the JVM threshold is used and it has been reached, the object won't be cached. If the pool is at maximum it will expire using its eviction policy and still cache the object. Cleanup will be done later.
mapping
- The structure of name value pairs to cachetimeout
- The timeout to use on the object (if any, provider specific)lastAccessTimeout
- The idle timeout to use on the object (if any, provider specific)prefix
- A prefix to prepend to the keyssets an object in cache. Sets might be expensive. If the JVM threshold is used and it has been reached, the object won't be cached. If the pool is at maximum it will expire using its eviction policy and still cache the object. Cleanup will be done later.
setQuiet
in interface
ICacheProvider
objectKey
- The object cache keyobject
- The object to cachetimeout
- The timeout to use on the object (if any, provider specific)lastAccessTimeout
- The idle timeout to use on the object (if any, provider specific)extra
- A map of name-value pairs to use as extra arguments to pass to a providers set operationShutdown command issued when CacheBox is going through shutdown phase
shutdown
in interface
ICacheProvider
JVM Threshold checks
threshold
- The threshold to checkValidate incoming set configuration data