coldbox.system.cache.ICacheProvider
The main interface for a CacheBox cache provider object, you implement it so CacheBox can manage it for you.
Method Summary | |
---|---|
any<boolean>
|
clear(any objectKey)
Clears an object from the cache by using its cache key. |
void
|
clearAll()
Clear all the cache elements from the cache. |
any<boolean>
|
clearQuiet(any objectKey)
Clears an object from the cache by using its cache key. |
void
|
clearStatistics()
Clear the cache statistics. |
void
|
configure()
This method makes the cache ready to accept elements and run. |
void
|
expireAll()
Expire all the elments in the cache (if supported by the provider). |
void
|
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. |
any<struct>
|
getCachedObjectMetadata(any objectKey)
Get a cache objects metadata about its performance. |
any<CacheFactory>
|
getCacheFactory()
Get the cache factory reference this cache provider belongs to. |
any<struct>
|
getConfiguration()
Get the structure of configuration parameters for the cache. |
any
|
getEventManager()
Get this cache managers event listener manager. |
any<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<IObjectStore>
|
getObjectStore()
If the cache provider implements it, this returns the cache's object store as type: coldbox. |
any
|
getQuiet(any objectKey)
Get an object from the cache without updating stats or listners. |
any<numeric>
|
getSize()
Get the number of elements in the cache. |
any<ICacheStats>
|
getStats()
Get the cache statistics object as coldbox. |
any<struct>
|
getStoreMetadataKeyMap()
Get a key lookup structure where cachebox can build the report on. |
any<struct>
|
getStoreMetadataReport()
Get a structure of all the keys in the cache with their appropriate metadata structures. |
any<Boolean>
|
isEnabled()
Returns a flag indicating if the cache is ready for operation. |
any<boolean>
|
isExpired(any objectKey)
Has the object key expired in the cache. |
any<Boolean>
|
isReportingEnabled()
Returns a flag indicating if the cache has reporting enabled. |
any<struct>
|
lookup(any objectKey)
Check if an object is in cache, if not found it records a miss. |
any<struct>
|
lookupQuiet(any objectKey)
Check if an object is in cache, no stats updated or listeners. |
void
|
reap()
Send a reap or flush command to the cache. |
any<struct>
|
set(any objectKey, any object, [any timeout], [any lastAccessTimeout], [any<struct> extra])
sets an object in cache and returns true if set correctly, else false. |
void
|
setCacheFactory(any<CacheFactory> cacheFactory)
Set the cache factory reference for this cache. |
void
|
setConfiguration(any<struct> configuration)
Set the entire configuration structure for this cache. |
void
|
setEventManager(any eventManager)
Set the event manager for this cache. |
void
|
setName(any name)
Set the cache name. |
any<struct>
|
setQuiet(any objectKey, any object, [any timeout], [any lastAccessTimeout], [any<struct> extra])
sets an object in cache and returns true if set correctly, else false. |
void
|
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. Usualy a cache is first created (init), then wired and then the factory calls configure() on it
Expire all the elments 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 object keyGet a cache objects metadata about its performance. This value is a structure of name-value pairs of metadata.
objectKey
- The key of the object to lookup its metadataGet the cache factory reference this cache provider belongs to
Get 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 as type: coldbox.system.cache.store.IObjectStore
Get an object from the cache without updating stats or listners
objectKey
- The object keyGet the number of elements in the cache
Get the cache statistics object as coldbox.system.cache.util.ICacheStats
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 object keyReturns 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 of the object to lookup.Check if an object is in cache, no stats updated or listeners
objectKey
- The key of the object to lookup.Send a reap or flush command to the cache
sets an object in cache and returns true if set correctly, else false.
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
Set the entire configuration structure for this cache
configuration
- The configuration structureSet the event manager for this cache
eventManager
- The event manager classSet the cache name
name
- The cache namesets an object in cache and returns true if set correctly, else false. With no statistic updates or listener updates
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