wirebox.system.cache.providers.ICacheProvider
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- The main interface for a CacheBox cache provider. You need to implement all the methods in order for CacheBox to work correctly for the implementing cache provider.
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. |
boolean
|
clearQuiet(any objectKey)
Clears an object from the cache by using its cache key. |
any
|
clearStatistics()
Clear the cache statistics. |
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. |
CacheFactory
|
getCacheFactory()
Get the cache factory reference this cache provider belongs to. |
struct
|
getCachedObjectMetadata(any objectKey)
Get a cache objects metadata about its performance. |
struct
|
getConfiguration()
Get the structure of configuration parameters for the cache. |
any
|
getEventManager()
Get this cache managers event listener manager. |
array
|
getKeys()
Returns a list of all elements in the cache, whether or not they are expired. |
any
|
getName()
Get the name of this cache. |
any
|
getObjectStore()
If the cache provider implements it, this returns the cache's object store. |
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. |
any
|
getStats()
Get the cache statistics object as wirebox. |
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. |
boolean
|
isEnabled()
Returns a flag indicating if the cache is ready for operation. |
boolean
|
isExpired(any objectKey)
Has the object key expired in the cache. |
boolean
|
isReportingEnabled()
Returns a flag indicating if the cache has reporting enabled. |
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. |
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
|
setCacheFactory(any<CacheFactory> cacheFactory)
Set the cache factory reference for this cache. |
any
|
setConfiguration(struct configuration)
Set the entire configuration structure for this cache. |
any
|
setEventManager(any eventManager)
Set the event manager for this cache. |
any
|
setName(any name)
Set the cache name. |
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. |
Method Detail |
---|
Clears an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore
objectKey
- The object cache keyClear all the cache elements from the cache
Clears 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
objectKey
- The object cache keyClear the cache statistics
This 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
Expire all the elements in the cache (if supported by the provider)
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)
objectKey
- The object cache keyGet an object from the cache and updates stats
objectKey
- The key to retrieveGet the cache factory reference this cache provider belongs to
Get a cache objects metadata about its performance. This value is a structure of name-value pairs of metadata.
objectKey
- The key to retrieveGet the structure of configuration parameters for the cache
Get this cache managers event listener manager
Returns a list of all elements in the cache, whether or not they are expired
Get the name of this cache
If the cache provider implements it, this returns the cache's object store.
Get an object from the cache without updating stats or listeners
objectKey
- The key to retrieveGet the number of elements in the cache
Get the cache statistics object as wirebox.system.cache.util.IStats
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
Get a structure of all the keys in the cache with their appropriate metadata structures. This is used to build the reporting.[keyX->[metadataStructure]]
Returns a flag indicating if the cache is ready for operation
Has the object key expired in the cache
objectKey
- The key to retrieveReturns a flag indicating if the cache has reporting enabled
Check if an object is in cache, if not found it records a miss.
objectKey
- The key to retrieveCheck if an object is in cache, no stats updated or listeners
objectKey
- The key to retrieveSend a reap or flush command to the cache
Sets an object in the cache and returns an instance of itself
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 operationSet the cache factory reference for this cache
cacheFactory
- The cache factorySet the entire configuration structure for this cache
configuration
- The cache configurationSet the event manager for this cache
eventManager
- The event manager to setSet the cache name
name
- The name to setSets an object in the cache with no event calls and returns an instance of itself
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