coldbox.system.cache.config

Class CacheBoxConfig

lucee.Component
    extended by coldbox.system.cache.config.CacheBoxConfig

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com ---- This is a CacheBox configuration object. You can use it to configure a CacheBox variables.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    struct DEFAULTS
          Get the static default configuration struct.

    • access = public
    • returntype = any
    true false
    struct caches
          The caches configuration.

    • access = public
    • returntype = any
    true false
    struct defaultCache
          The default cache config.

    • access = public
    • returntype = any
    true false
    array listeners
          The scope configuration settings.

    • access = public
    • returntype = any
    true false
    any logBoxConfig
          The logbox config dsl this config object represents.

    • access = public
    • returntype = any
    true false
    struct scopeRegistration
          The scope configuration settings.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init([any CFCConfig], [string CFCConfigPath])
          Constructor.
    Method Summary
    any cache(any name, [string provider='[runtime expression]'], [struct properties='[runtime expression]'])
         Add a new cache config.
    boolean cacheExists(any name)
         Check if a cache definition exists.
    CacheBoxConfig defaultCache([numeric objectDefaultTimeout], [numeric objectDefaultLastAccessTimeout], [numeric reapFrequency], [numeric maxObjects], [numeric freeMemoryPercentageThreshold], [boolean useLastAccessTimeouts], [string evictionPolicy], [numeric evictCount], [string objectStore], [boolean coldboxEnabled])
         Setup the default cache.
    struct getCache(any name)
         Get a specified cache definition.
    string getCaches()
    string getDEFAULTS()
    string getDefaultCache()
    string getListeners()
    string getLogBoxConfig()
    struct getMemento()
         A quick snapshot of the state.
    string getScopeRegistration()
    CacheBoxConfig listener(any class, [struct properties='[runtime expression]'], [any name=''])
         Add a new listener configuration.
    CacheBoxConfig loadDataDSL(struct rawDSL)
         Load a data configuration CFC data DSL.
    CacheBoxConfig logBoxConfig(string config)
         Set the logBox Configuration to use.
    CacheBoxConfig reset()
         Reset the configuration.
    CacheBoxConfig resetCaches()
         Reset the set caches.
    CacheBoxConfig resetDefaultCache()
         Reset the default cache configurations.
    CacheBoxConfig resetListeners()
         Reset the set listeners.
    any scopeRegistration([boolean enabled='[runtime expression]'], [string scope='[runtime expression]'], [string key='[runtime expression]'])
         Define the cachebox factory scope registration.
    any setCaches(struct caches)
    any setDEFAULTS(struct DEFAULTS)
    any setDefaultCache(struct defaultCache)
    any setListeners(array listeners)
    any setLogBoxConfig(any logBoxConfig)
    any setScopeRegistration(struct scopeRegistration)
    CacheBoxConfig validate()
         Validates the configuration.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([any CFCConfig], [string CFCConfigPath])

    Constructor

    Parameters:
    CFCConfig - The cacheBox Data Configuration CFC instance
    CFCConfigPath - The cacheBox Data Configuration CFC path to use

    Property Detail

    DEFAULTS

    property struct DEFAULTS

    Get the static default configuration struct

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

    caches

    property struct caches

    The caches configuration

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

    defaultCache

    property struct defaultCache

    The default cache config

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

    listeners

    property array listeners

    The scope configuration settings

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

    logBoxConfig

    property any logBoxConfig

    The logbox config dsl this config object represents

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

    scopeRegistration

    property struct scopeRegistration

    The scope configuration settings

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

    Method Detail

    cache

    public any cache(any name, [string provider='[runtime expression]'], [struct properties='[runtime expression]'])

    Add a new cache config

    Parameters:
    name - The cache name
    provider - The cache provider class, defaults to: coldbox.system.cache.providers.CacheBoxProvider
    properties - The structure of properties for the cache

    cacheExists

    public boolean cacheExists(any name)

    Check if a cache definition exists

    Parameters:
    name - The cache name

    defaultCache

    public CacheBoxConfig defaultCache([numeric objectDefaultTimeout], [numeric objectDefaultLastAccessTimeout], [numeric reapFrequency], [numeric maxObjects], [numeric freeMemoryPercentageThreshold], [boolean useLastAccessTimeouts], [string evictionPolicy], [numeric evictCount], [string objectStore], [boolean coldboxEnabled])

    Setup the default cache

    Parameters:
    objectDefaultTimeout - The default object timeout in minutes
    objectDefaultLastAccessTimeout - The last access or idle timeout in minutes
    reapFrequency - The reaping frequency in minutes
    maxObjects - The max objects to store
    freeMemoryPercentageThreshold - Activate free ram thresholds
    useLastAccessTimeouts - use idle timeouts
    evictionPolicy - The eviction policy to use
    evictCount - How many objects to evict
    objectStore - The storage provider
    coldboxEnabled - Is this ColdBox enabled or standalone

    getCache

    public struct getCache(any name)

    Get a specified cache definition

    Parameters:
    name - The cache name

    getCaches

    public string getCaches()


    getDEFAULTS

    public string getDEFAULTS()


    getDefaultCache

    public string getDefaultCache()


    getListeners

    public string getListeners()


    getLogBoxConfig

    public string getLogBoxConfig()


    getMemento

    public struct getMemento()

    A quick snapshot of the state


    getScopeRegistration

    public string getScopeRegistration()


    listener

    public CacheBoxConfig listener(any class, [struct properties='[runtime expression]'], [any name=''])

    Add a new listener configuration

    Parameters:
    class - The class of the listener
    properties - The struct of properties for the listener
    name - The unique name of the listener

    loadDataDSL

    public CacheBoxConfig loadDataDSL(struct rawDSL)

    Load a data configuration CFC data DSL

    Parameters:
    rawDSL

    logBoxConfig

    public CacheBoxConfig logBoxConfig(string config)

    Set the logBox Configuration to use

    Parameters:
    config - The configuration file to use

    reset

    public CacheBoxConfig reset()

    Reset the configuration


    resetCaches

    public CacheBoxConfig resetCaches()

    Reset the set caches


    resetDefaultCache

    public CacheBoxConfig resetDefaultCache()

    Reset the default cache configurations


    resetListeners

    public CacheBoxConfig resetListeners()

    Reset the set listeners


    scopeRegistration

    public any scopeRegistration([boolean enabled='[runtime expression]'], [string scope='[runtime expression]'], [string key='[runtime expression]'])

    Define the cachebox factory scope registration

    Parameters:
    enabled - Enable registration
    scope - The scope to register on, defaults to application scope
    key - The key to use in the scope, defaults to cachebox

    setCaches

    public any setCaches(struct caches)

    Parameters:
    caches

    setDEFAULTS

    public any setDEFAULTS(struct DEFAULTS)

    Parameters:
    DEFAULTS

    setDefaultCache

    public any setDefaultCache(struct defaultCache)

    Parameters:
    defaultCache

    setListeners

    public any setListeners(array listeners)

    Parameters:
    listeners

    setLogBoxConfig

    public any setLogBoxConfig(any logBoxConfig)

    Parameters:
    logBoxConfig

    setScopeRegistration

    public any setScopeRegistration(struct scopeRegistration)

    Parameters:
    scopeRegistration

    validate

    public CacheBoxConfig validate()

    Validates the configuration. If not valid, it will throw an appropriate exception.

    Throws:
    CacheBoxConfig.NoDefaultCacheFound