railo-context.Component coldbox.system.cache.CacheFactory
The ColdBox CacheBox Factory
Constructor Summary | |
---|---|
init([any<CacheBoxConfig> config], [any<Controller> coldbox], [any factoryID=''])
Constructor. |
Method Summary | |
---|---|
void
|
addCache(any<ICacheProvider> cache)
Register a new instantiated cache with this cache factory. |
any<ICacheProvider>
|
addDefaultCache(any name)
Add a default named cache to our registry, create it, config it, register it and return it of type: coldbox. |
any<Boolean>
|
cacheExists(any name)
Check if the passed in named cache is already registered in this factory or not. |
void
|
clearAll()
Clears all the elements in all the registered caches without de-registrations. |
void
|
configure(any<CacheBoxConfig> config)
Configure the cache factory for operation, called by the init(). |
private void
|
configureEventManager()
Configure a standalone version of a ColdBox Event Manager. |
private void
|
configureLogBox()
Configure a standalone version of logBox for logging. |
any<ICacheProvider>
|
createCache(any name, any provider, [any<struct> properties='[runtime expression]'])
Create a new cache according the the arguments, register it and return it of type: coldbox. |
private void
|
doScopeRegistration()
Register this cachefactory on a user specified scope. |
void
|
expireAll()
Expires all the elements in all the registered caches without de-registrations. |
any<ICacheProvider>
|
getCache(any name)
Get a reference to a registered cache in this factory. |
any<array>
|
getCacheNames()
Get the array of caches registered with this factory. |
any<Struct>
|
getCaches()
Get a reference to all the registered caches in the cache factory as a structure. |
any<Controller>
|
getColdbox()
Get the instance of ColdBox linked in this cache factory. |
any<CacheBoxConfig>
|
getConfig()
Get this LogBox's configuration object. |
any<ICacheProvider>
|
getDefaultCache()
Get the default cache provider of type coldbox. |
any
|
getEventManager()
Get the cache factory's event manager. |
any
|
getFactoryID()
Get the unique ID of this cache factory. |
any<LogBox>
|
getLogBox()
Get the instance of LogBox configured for this cache factory. |
any<struct>
|
getScopeRegistration()
Get the scope registration information. |
private any<Util>
|
getUtil()
Create and return a util object. |
any
|
getVersion()
Get the CacheBox version string. |
any<Boolean>
|
isColdBoxLinked()
Checks if Coldbox application controller is linked. |
void
|
reapAll()
A nice way to call reap on all registered caches. |
private void
|
registerCache(any<ICacheProvider> cache)
Register a cache instance internaly. |
private void
|
registerListeners()
Register all the configured listeners in the configuration file. |
void
|
removeAll()
Remove all the registered caches in this factory, this triggers individual cache shutdowns. |
any<Boolean>
|
removeCache(any name)
Try to remove a named cache from this factory, returns Boolean if successfull or not. |
void
|
removeFromScope()
Remove the cache factory from scope registration if enabled, else does nothing. |
void
|
replaceCache(any<ICacheProvider> cache, any<ICacheProvider> decoratedCache)
Replace a registered named cache with a new decorated cache of the same name. |
void
|
shutdown()
Recursively sends shutdown commands to al registered caches and cleans up in preparation for shutdown. |
void
|
shutdownCache(any name)
Send a shutdown command to a specific cache provider to bring down gracefully. |
Methods inherited from class railo-context.Component |
---|
None |
Constructor Detail |
---|
Constructor
config
- The CacheBoxConfig object or path to use to configure this instance of CacheBox. If not passed then CacheBox will instantiate the default configuration.coldbox
- A coldbox application that this instance of CacheBox can be linked to, if not using it, just ignore it.factoryID
- A unique ID or name for this factory. If not passed I will make one up for you.Method Detail |
---|
Register a new instantiated cache with this cache factory
cache
- The cache instance to register with this factory of type: coldbox.system.cache.ICacheProviderAdd a default named cache to our registry, create it, config it, register it and return it of type: coldbox.system.cache.ICacheProvider
name
- The name of the default cache to createCheck if the passed in named cache is already registered in this factory or not
name
- The name of the cache to checkClears all the elements in all the registered caches without de-registrations
Configure the cache factory for operation, called by the init(). You can also re-configure CacheBox programmatically.
config
- The CacheBoxConfig object to use to configure this instance of CacheBoxConfigure a standalone version of a ColdBox Event Manager
Configure a standalone version of logBox for logging
Create a new cache according the the arguments, register it and return it of type: coldbox.system.cache.ICacheProvider
name
- The name of the cache to addprovider
- The provider class path of the cache to addproperties
- The properties of the cache to configure withRegister this cachefactory on a user specified scope
Expires all the elements in all the registered caches without de-registrations
Get a reference to a registered cache in this factory. If the cache does not exist it will return an exception. Type: coldbox.system.cache.ICacheProvider
name
- The named cache to retrieveGet the array of caches registered with this factory
Get a reference to all the registered caches in the cache factory as a structure
Get the instance of ColdBox linked in this cache factory. Empty if using standalone version
Get this LogBox's configuration object.
Get the default cache provider of type coldbox.system.cache.ICacheProvider
Get the cache factory's event manager
Get the unique ID of this cache factory
Get the instance of LogBox configured for this cache factory
Get the scope registration information
Create and return a util object
Get the CacheBox version string.
Checks if Coldbox application controller is linked
A nice way to call reap on all registered caches
Register a cache instance internaly
cache
- The cache instance to register with this factory of type: coldbox.system.cache.ICacheProviderRegister all the configured listeners in the configuration file
Remove all the registered caches in this factory, this triggers individual cache shutdowns
Try to remove a named cache from this factory, returns Boolean if successfull or not
name
- The name of the cache to removeRemove the cache factory from scope registration if enabled, else does nothing
Replace a registered named cache with a new decorated cache of the same name.
cache
- The name of the cache to replace or the actual instance of the cache to replacedecoratedCache
- The decorated cache manager instance to replace with of type coldbox.system.cache.ICacheProviderRecursively sends shutdown commands to al registered caches and cleans up in preparation for shutdown
Send a shutdown command to a specific cache provider to bring down gracefully. It also removes it from the cache factory
name
- The cache provider name to shutdown