coldbox.system.cache.config

Class CacheBoxConfig

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

This is a CacheBox configuration object. You can use it to configure a CacheBox instance

Class Attributes:
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Constructor Summary
    init([any CFCConfig], [string CFCConfigPath])
          Constructor.
    Method Summary
    any cache(string name, [string provider='[runtime expression]'], [struct properties='[runtime expression]'])
         Add a new cache configuration.
    boolean cacheExists(string name)
         Check if a cache definition exists.
    any defaultCache([numeric objectDefaultTimeout], [numeric objectDefaultLastAccessTimeout], [numeric reapFrequency], [numeric maxObjects], [numeric freeMemoryPercentageThreshold], [boolean useLastAccessTimeouts], [string evictionPolicy], [numeric evictCount], [string objectStore], [boolean coldboxEnabled])
         Add a default cache configuration.
    struct getCache(string name)
         Get a specifed cache definition.
    struct getCaches()
         Get the configured caches.
    struct getDefaultCache()
         Get the defaultCache definition.
    struct getDefaults()
         Get the default CacheBox settings.
    array getListeners()
         Get the configured listeners.
    string getLogBoxConfig()
         Get the logBox Configuration file to use.
    struct getMemento()
         Get the instance data.
    struct getScopeRegistration()
         Get the scope registration details.
    any listener(string class, [struct properties='[runtime expression]'], [string name=''])
         Add a new listener configuration.
    void loadDataDSL(struct rawDSL)
         Load a data configuration CFC data DSL.
    any logBoxConfig(string config)
         Set the logBox Configuration to use.
    void reset()
         Reset the configuration.
    void resetCaches()
         Reset the set caches.
    void resetDefaultCache()
         Reset the default cache configurations.
    void resetListeners()
         Reset the cache listeners.
    any scopeRegistration([boolean enabled='[runtime expression]'], [string scope='[runtime expression]'], [string key='[runtime expression]'])
         Use to define cachebox factory scope registration.
    void 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
    CFCConfigPath - The cacheBox Data Configuration CFC path to use

    Method Detail

    cache

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

    Add a new cache configuration.

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

    cacheExists

    public boolean cacheExists(string name)

    Check if a cache definition exists

    Parameters:
    name - The cache to check

    defaultCache

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

    Add a default cache configuration.

    Parameters:
    objectDefaultTimeout
    objectDefaultLastAccessTimeout
    reapFrequency
    maxObjects
    freeMemoryPercentageThreshold
    useLastAccessTimeouts
    evictionPolicy
    evictCount
    objectStore
    coldboxEnabled

    getCache

    public struct getCache(string name)

    Get a specifed cache definition

    Parameters:
    name - The cache configuration to retrieve

    getCaches

    public struct getCaches()

    Get the configured caches


    getDefaultCache

    public struct getDefaultCache()

    Get the defaultCache definition.


    getDefaults

    public struct getDefaults()

    Get the default CacheBox settings


    getListeners

    public array getListeners()

    Get the configured listeners


    getLogBoxConfig

    public string getLogBoxConfig()

    Get the logBox Configuration file to use


    getMemento

    public struct getMemento()

    Get the instance data


    getScopeRegistration

    public struct getScopeRegistration()

    Get the scope registration details


    listener

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

    Add a new listener configuration.

    Parameters:
    class - The class of the listener
    properties - The structure of properties for the listner
    name - The name of the listener

    loadDataDSL

    public void loadDataDSL(struct rawDSL)

    Load a data configuration CFC data DSL

    Parameters:
    rawDSL - The data configuration DSL structure

    logBoxConfig

    public any logBoxConfig(string config)

    Set the logBox Configuration to use

    Parameters:
    config - The configuration file to use

    reset

    public void reset()

    Reset the configuration


    resetCaches

    public void resetCaches()

    Reset the set caches


    resetDefaultCache

    public void resetDefaultCache()

    Reset the default cache configurations


    resetListeners

    public void resetListeners()

    Reset the cache listeners


    scopeRegistration

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

    Use to define 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

    validate

    public void validate()

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