lucee.Componentwirebox.system.cache.AbstractCacheBoxProvider
wirebox.system.cache.providers.MockProvider
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com ---- A mock cache provider that keeps cache data in a simple map for testing and assertions
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
struct
|
cache
The in memory mocking cache.
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
boolean
|
clear(any objectKey)
Clears an object from the cache by using its cache key. |
any
|
clearAll()
Clear all the cache elements from the cache. |
any
|
clearAllEvents([boolean async='false'])
Clears all events from the cache. |
any
|
clearAllViews([boolean async='false'])
Clears all views from the cache. |
any
|
clearEvent(any eventSnippet, [any queryString=''])
Clears all the event permutations from the cache according to snippet and querystring. |
any
|
clearEventMulti(any eventsnippets, [any queryString=''])
Clears all the event permutations from the cache according to the list of snippets and querystrings. |
boolean
|
clearQuiet(any objectKey)
Clears an object from the cache by using its cache key. |
any
|
clearView(any viewSnippet)
Clears all view name permutations from the cache according to the view name. |
any
|
clearViewMulti(any viewSnippets)
Clears all view name permutations from the cache according to the view name. |
any
|
configure()
This method makes the cache ready to accept elements and run. |
any
|
expireAll()
Expire all the elements in the cache (if supported by the provider). |
any
|
expireObject(any objectKey)
Expires an object from the cache by using its cache key. |
any
|
get(any objectKey)
Get an object from the cache and updates stats. |
string
|
getCache()
|
struct
|
getCachedObjectMetadata(any objectKey)
Get a cache objects metadata about its performance. |
any
|
getColdbox()
Get the coldbox application reference as wirebox. |
any
|
getEventCacheKeyPrefix()
Get the event cache key prefix which is necessary for event caching. |
any
|
getEventURLFacade()
Get the event caching URL facade utility that determines event caching. |
array
|
getKeys()
Returns a list of all elements in the cache, whether or not they are expired. |
any
|
getObjectStore()
If the cache provider implements it, this returns the cache's object store as type: wirebox. |
any
|
getQuiet(any objectKey)
Get an object from the cache without updating stats or listeners. |
numeric
|
getSize()
Get the number of elements in the cache. |
struct
|
getStoreMetadataKeyMap()
Get a key lookup structure where cachebox can build the report on. |
struct
|
getStoreMetadataReport()
Get a structure of all the keys in the cache with their appropriate metadata structures. |
any
|
getViewCacheKeyPrefix()
Get the cached view key prefix which is necessary for view caching. |
boolean
|
isExpired(any objectKey)
Has the object key expired in the cache. |
boolean
|
lookup(any objectKey)
Check if an object is in cache, if not found it records a miss. |
boolean
|
lookupQuiet(any objectKey)
Check if an object is in cache, no stats updated or listeners. |
boolean
|
lookupValue(any objectValue)
Check if an object is in cache, if not found it records a miss. |
any
|
reap()
Send a reap or flush command to the cache. |
any
|
set(any objectKey, any object, [any timeout], [any lastAccessTimeout], [struct extra])
Sets an object in the cache and returns an instance of itself. |
any
|
setCache(struct cache)
|
any
|
setColdBox(any<wirebox.system.web.Controller> coldbox)
Set the ColdBox linkage into the provider. |
any
|
setQuiet(any objectKey, any object, [any timeout], [any lastAccessTimeout], [struct extra])
Sets an object in the cache with no event calls and returns an instance of itself. |
any
|
shutdown()
Shutdown command issued when CacheBox is going through shutdown phase. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
The in memory mocking cache
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Clears 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 all events from the cache.
clearAllEvents
in interface
IColdBoxProvider
async
- If implemented, determines async or sync clearing.Clears all views from the cache.
clearAllViews
in interface
IColdBoxProvider
async
- Run command asynchronously or notClears all the event permutations from the cache according to snippet and querystring. Be careful when using incomplete event name with query strings as partial event names are not guaranteed to match with query string permutations
clearEvent
in interface
IColdBoxProvider
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 purposesClears all the event permutations from the cache according to the list of snippets and querystrings. Be careful when using incomplete event name with query strings as partial event names are not guaranteed to match with query string permutations
clearEventMulti
in interface
IColdBoxProvider
eventsnippets
queryString
- The comma-delimited 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 inClears an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore without doing statistics or updating listeners
clearQuiet
in interface
ICacheProvider
objectKey
- The object cache keyClears all view name permutations from the cache according to the view name
clearView
in interface
IColdBoxProvider
viewSnippet
- The view name snippet to purge from the cacheClears all view name permutations from the cache according to the view name.
clearViewMulti
in interface
IColdBoxProvider
viewSnippets
- The comma-delimited list or array of view snippet to clear on. Can be partial or fullThis method makes the cache ready to accept elements and run. Usually a cache is first created (init), then wired and then the factory calls configure() on it
configure
in interface
ICacheProvider
Expire all the elements in the cache (if supported by the provider)
expireAll
in interface
ICacheProvider
Expires an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore (if supported by the provider)
expireObject
in interface
ICacheProvider
objectKey
- The object cache keyGet an object from the cache and updates stats
get
in interface
ICacheProvider
objectKey
- The key to retrieveGet a cache objects metadata about its performance. This value is a structure of name-value pairs of metadata.
getCachedObjectMetadata
in interface
ICacheProvider
objectKey
- The key to retrieveGet the coldbox application reference as wirebox.system.web.Controller
getColdbox
in interface
IColdBoxProvider
Get the event cache key prefix which is necessary for event caching
getEventCacheKeyPrefix
in interface
IColdBoxProvider
Get the event caching URL facade utility that determines event caching
getEventURLFacade
in interface
IColdBoxProvider
Returns a list of all elements in the cache, whether or not they are expired
getKeys
in interface
ICacheProvider
If the cache provider implements it, this returns the cache's object store as type: wirebox.system.cache.store.IObjectStore
getObjectStore
in interface
ICacheProvider
Get an object from the cache without updating stats or listeners
getQuiet
in interface
ICacheProvider
objectKey
- The key to retrieveGet the number of elements in the cache
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
Get the cached view key prefix which is necessary for view caching
getViewCacheKeyPrefix
in interface
IColdBoxProvider
Has the object key expired in the cache
isExpired
in interface
ICacheProvider
objectKey
- The key to retrieveCheck if an object is in cache, if not found it records a miss.
lookup
in interface
ICacheProvider
objectKey
- The key to retrieveCheck if an object is in cache, no stats updated or listeners
lookupQuiet
in interface
ICacheProvider
objectKey
- The key to retrieveCheck if an object is in cache, if not found it records a miss.
objectValue
- The value to retrieveSend a reap or flush command to the cache
reap
in interface
ICacheProvider
Sets an object in the cache and returns an instance of itself
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 operationcache
Set the ColdBox linkage into the provider
setColdBox
in interface
IColdBoxProvider
coldbox
- The ColdBox controllerSets an object in the cache with no event calls and returns an instance of itself
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