|
ColdBox Platform v3.8.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.cache.CacheFactory
public class 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<coldbox.system.logging.LogBox> |
getLogBox()
Get the instance of LogBox configured for this cache factory |
any<struct> |
getScopeRegistration()
Get the scope registration information |
private any<coldbox.system.core.util.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 WEB-INF.cftags.component |
---|
None
|
Constructor Detail |
---|
public init([any<CacheBoxConfig> config], [any<Controller> coldbox], [any factoryID=''])
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 |
---|
public void addCache(any<ICacheProvider> cache)
cache
- The cache instance to register with this factory of type: coldbox.system.cache.ICacheProviderpublic any<ICacheProvider> addDefaultCache(any name)
name
- The name of the default cache to createpublic any<Boolean> cacheExists(any name)
name
- The name of the cache to checkpublic void clearAll()
public void configure(any<CacheBoxConfig> config)
config
- The CacheBoxConfig object to use to configure this instance of CacheBoxprivate void configureEventManager()
private void configureLogBox()
public any<ICacheProvider> createCache(any name, any provider, [any<struct> properties='[runtime expression]'])
name
- The name of the cache to addprovider
- The provider class path of the cache to addproperties
- The properties of the cache to configure withprivate void doScopeRegistration()
public void expireAll()
public any<ICacheProvider> getCache(any name)
name
- The named cache to retrievepublic any<array> getCacheNames()
public any<Struct> getCaches()
public any<Controller> getColdbox()
public any<CacheBoxConfig> getConfig()
public any<ICacheProvider> getDefaultCache()
public any getEventManager()
public any getFactoryID()
public any<coldbox.system.logging.LogBox> getLogBox()
public any<struct> getScopeRegistration()
private any<coldbox.system.core.util.Util> getUtil()
public any getVersion()
public any<Boolean> isColdBoxLinked()
public void reapAll()
private void registerCache(any<ICacheProvider> cache)
cache
- The cache instance to register with this factory of type: coldbox.system.cache.ICacheProviderprivate void registerListeners()
public void removeAll()
public any<Boolean> removeCache(any name)
name
- The name of the cache to removepublic void removeFromScope()
public void replaceCache(any<ICacheProvider> cache, any<ICacheProvider> decoratedCache)
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.ICacheProviderpublic void shutdown()
public void shutdownCache(any name)
name
- The cache provider name to shutdown
|
ColdBox Platform v3.8.0 | ||||
FRAMES |