coldbox.system.cache.providers

Class CFProvider

lucee.Component
    extended by coldbox.system.cache.AbstractCacheBoxProvider
      extended by coldbox.system.cache.providers.CFProvider
All Implemented Interfaces:
ICacheProvider
Direct Known Subclasses:
CFColdBoxProvider

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This CacheBox provider communicates with the built in caches in the Adobe ColdFusion Engines

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • serializable : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any elementCleaner
          The global element cleaner utility object.

    • access = public
    • returntype = any
    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.
    boolean clearQuiet(any objectKey)
         Clears an object from the cache by using its cache key.
    any clearStatistics()
         Clear the cache statistics.
    any configure()
         configure the cache for operation.
    any expireAll()
         Expire all the elments in the cache (if supported by the provider): Not implemented by this cache.
    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.
    struct getCachedObjectMetadata(any objectKey)
         Get a cache objects metadata about its performance.
    string getElementCleaner()
    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.
    any getOrSet(any objectKey, any produce, [any timeout='0'], [any lastAccessTimeout='0'], [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 item silently from cache, no stats advised: Stats not available on lucee.
    numeric getSize()
         Get the number of elements in the cache.
    any getStats()
         Get the cache statistics object as coldbox.
    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 isClusterCoherent()
    private boolean isDefaultCache()
         Checks if the default cache is in use or another cache region.
    boolean isExpired(any objectKey)
         Has the object key expired in the cache: NOT IMPLEMENTED IN THIS CACHE.
    boolean isNodeCoherent()
    boolean isTerracotaClustered()
    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: Not implemented by this provider.
    any set(any objectKey, any object, [any timeout='0'], [any lastAccessTimeout='0'], [struct extra])
         Sets an object in the cache and returns an instance of itself.
    any setElementCleaner(any elementCleaner)
    any setQuiet(any objectKey, any object, [any timeout='0'], [any lastAccessTimeout='0'], [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.
    private any validateConfiguration()
         Validate the incoming configuration and make necessary defaults.
     
    Methods inherited from class coldbox.system.cache.AbstractCacheBoxProvider
    clearByKeySnippet, clearMulti, getCachedObjectMetadataMulti, getCacheFactory, getCacheId, getConfiguration, getEnabled, getEventManager, getMemento, getMulti, getName, getReportingEnabled, getUtility, getUuidHelper, inThread, isEnabled, isReportingEnabled, lookupMulti, randomUUID, setCacheFactory, setCacheId, setConfiguration, setEnabled, setEventManager, setMulti, setName, setReportingEnabled, setStats, setUtility, setUuidHelper, statusCheck
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    elementCleaner

    property any elementCleaner

    The global element cleaner utility object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    clear

    public boolean clear(any objectKey)

    Clears an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore

    Specified by:
    clear in interface ICacheProvider
    Parameters:
    objectKey - The object cache key

    clearAll

    public any clearAll()

    Clear all the cache elements from the cache

    Specified by:
    clearAll in interface ICacheProvider
    Returns:
    ICacheProvider

    clearQuiet

    public boolean clearQuiet(any objectKey)

    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

    Specified by:
    clearQuiet in interface ICacheProvider
    Parameters:
    objectKey - The object cache key

    clearStatistics

    public any clearStatistics()

    Clear the cache statistics NOT IMPLEMENTED FOR ACF 2016+

    Specified by:
    clearStatistics in interface ICacheProvider
    Overrides:
    clearStatistics in class AbstractCacheBoxProvider
    Returns:
    ICacheProvider

    configure

    public any configure()

    configure the cache for operation

    Specified by:
    configure in interface ICacheProvider
    Returns:
    LuceeProvider

    expireAll

    public any expireAll()

    Expire all the elments in the cache (if supported by the provider): Not implemented by this cache

    Specified by:
    expireAll in interface ICacheProvider
    Returns:
    ICacheProvider

    expireObject

    public any expireObject(any objectKey)

    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) Not implemented by this cache

    Specified by:
    expireObject in interface ICacheProvider
    Parameters:
    objectKey - The object cache key
    Returns:
    ICacheProvider

    get

    public any get(any objectKey)

    Get an object from the cache

    Specified by:
    get in interface ICacheProvider
    Parameters:
    objectKey - The key to retrieve

    getCachedObjectMetadata

    public struct getCachedObjectMetadata(any objectKey)

    Get a cache objects metadata about its performance. This value is a structure of name-value pairs of metadata.

    Specified by:
    getCachedObjectMetadata in interface ICacheProvider
    Parameters:
    objectKey - The key to retrieve

    getElementCleaner

    public string getElementCleaner()


    getKeys

    public array getKeys()

    Returns a list of all elements in the cache, whether or not they are expired

    Specified by:
    getKeys in interface ICacheProvider

    getObjectStore

    public any getObjectStore()

    If the cache provider implements it, this returns the cache's object store.

    Specified by:
    getObjectStore in interface ICacheProvider
    Returns:
    coldbox.system.cache.store.IObjectStore or any depending on the cache implementation

    getOrSet

    public any getOrSet(any objectKey, any produce, [any timeout='0'], [any lastAccessTimeout='0'], [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

    Overrides:
    getOrSet in class AbstractCacheBoxProvider
    Parameters:
    objectKey - The object cache key
    produce - The producer closure/lambda
    timeout - 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 operation
    Returns:
    The cached or produced data/object

    getQuiet

    public any getQuiet(any objectKey)

    get an item silently from cache, no stats advised: Stats not available on lucee

    Specified by:
    getQuiet in interface ICacheProvider
    Parameters:
    objectKey - The key to retrieve

    getSize

    public numeric getSize()

    Get the number of elements in the cache

    Specified by:
    getSize in interface ICacheProvider

    getStats

    public any getStats()

    Get the cache statistics object as coldbox.system.cache.util.IStats

    Specified by:
    getStats in interface ICacheProvider
    Overrides:
    getStats in class AbstractCacheBoxProvider
    Returns:
    coldbox.system.cache.util.IStats

    getStoreMetadataKeyMap

    public struct getStoreMetadataKeyMap()

    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

    Specified by:
    getStoreMetadataKeyMap in interface ICacheProvider

    getStoreMetadataReport

    public struct getStoreMetadataReport()

    Get a structure of all the keys in the cache with their appropriate metadata structures. This is used to build the reporting.[keyX->[metadataStructure]]

    Specified by:
    getStoreMetadataReport in interface ICacheProvider

    isClusterCoherent

    public boolean isClusterCoherent()


    isDefaultCache

    private boolean isDefaultCache()

    Checks if the default cache is in use or another cache region


    isExpired

    public boolean isExpired(any objectKey)

    Has the object key expired in the cache: NOT IMPLEMENTED IN THIS CACHE

    Specified by:
    isExpired in interface ICacheProvider
    Parameters:
    objectKey - The key to retrieve

    isNodeCoherent

    public boolean isNodeCoherent()


    isTerracotaClustered

    public boolean isTerracotaClustered()


    lookup

    public boolean lookup(any objectKey)

    Check if an object is in cache, if not found it records a miss.

    Specified by:
    lookup in interface ICacheProvider
    Parameters:
    objectKey - The key to retrieve

    lookupQuiet

    public boolean lookupQuiet(any objectKey)

    Check if an object is in cache, no stats updated or listeners

    Specified by:
    lookupQuiet in interface ICacheProvider
    Parameters:
    objectKey - The key to retrieve

    reap

    public any reap()

    Send a reap or flush command to the cache: Not implemented by this provider

    Specified by:
    reap in interface ICacheProvider
    Returns:
    ICacheProvider

    set

    public any set(any objectKey, any object, [any timeout='0'], [any lastAccessTimeout='0'], [struct extra])

    Sets an object in the cache and returns an instance of itself

    Specified by:
    set in interface ICacheProvider
    Parameters:
    objectKey - The object cache key
    object - The object to cache
    timeout - 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 operation
    Returns:
    ICacheProvider

    setElementCleaner

    public any setElementCleaner(any elementCleaner)

    Parameters:
    elementCleaner

    setQuiet

    public any setQuiet(any objectKey, any object, [any timeout='0'], [any lastAccessTimeout='0'], [struct extra])

    Sets an object in the cache with no event calls and returns an instance of itself

    Specified by:
    setQuiet in interface ICacheProvider
    Parameters:
    objectKey - The object cache key
    object - The object to cache
    timeout - 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 operation
    Returns:
    ICacheProvider

    shutdown

    public any shutdown()

    Shutdown command issued when CacheBox is going through shutdown phase

    Specified by:
    shutdown in interface ICacheProvider
    Returns:
    LuceeProvider

    validateConfiguration

    private any validateConfiguration()

    Validate the incoming configuration and make necessary defaults

    Overrides:
    validateConfiguration in class AbstractCacheBoxProvider
    Returns:
    LuceeProvider