coldbox.system.web.services

Class ModuleService

lucee.Component
    extended by coldbox.system.web.services.BaseService
      extended by coldbox.system.web.services.ModuleService

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- I oversee and manage ColdBox modules

Class Attributes:
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any cfmappingRegistry
          CF Mapping registry Dictionary.

    • access = public
    • returntype = any
    true false
    any logger
          Logger object.

    • access = public
    • returntype = any
    true false
    any mConfigCache
          Configuration cache dictionary.

    • access = public
    • returntype = any
    true false
    any moduleRegistry
          Module registry dictionary.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any controller)
          Constructor.
    Method Summary
    any activateAllModules()
         Go over all the loaded module configurations and activate them for usage within the{application.
    ModuleService activateModule(any moduleName)
         Activate a module.
    private any buildRegistry(array locations)
         Build the modules registry.
    private boolean canLoad(any moduleName)
         Checks if the module can be loaded or registered.
    array getLoadedModules()
         Get a listing of all loaded modules.
    struct getModuleConfigCache()
         Return the loaded module's configuration objects.
    struct getModuleRegistry()
         Get the discovered module's registry structure.
    boolean isModuleActive(any moduleName)
         Check and see if a module has been activated.
    any isModuleRegistered(any moduleName)
         Check and see if a module has been registered.
    any loadMappings()
         Load all module mappings.
    any loadModuleConfiguration(struct config, any moduleName)
         Load the module configuration object and return it.
    ModuleService onConfigurationLoad()
         Called by loader service when configuration file loads.
    ModuleService onShutdown()
         Called when the application stops.
    ModuleService rebuildModuleRegistry()
         Rescan the module locations directories and re-register all located modules, this{method does NOT register or activate any modules, it just reloads the found registry.
    ModuleService registerAllModules()
         Register all modules for the application.
    any registerAndActivateModule(any moduleName, [any invocationPath=''])
         Register and activate a new module.
    boolean registerModule(any moduleName, [any invocationPath=''], [any parent=''], [boolean force='false'])
         Register a module's configuration information and config object.
    ModuleService reload(any moduleName)
         Reload a targeted module.
    ModuleService reloadAll()
         Reload all modules.
    private any scanModulesDirectory(any dirPath)
         Get an array of modules found and add to the registry structure.
    boolean unload(any moduleName)
         Unload a module if found from the configuration.
    ModuleService unloadAll()
         Unload all registered modules.
     
    Methods inherited from class coldbox.system.web.services.BaseService
    getController, setController
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any controller)

    Constructor

    Parameters:
    controller

    Property Detail

    cfmappingRegistry

    property any cfmappingRegistry

    CF Mapping registry Dictionary

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

    logger

    property any logger

    Logger object

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

    mConfigCache

    property any mConfigCache

    Configuration cache dictionary

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

    moduleRegistry

    property any moduleRegistry

    Module registry dictionary

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

    Method Detail

    activateAllModules

    public any activateAllModules()

    Go over all the loaded module configurations and activate them for usage within the{application


    activateModule

    public ModuleService activateModule(any moduleName)

    Activate a module

    Parameters:
    moduleName - The name of the module to load. It must exist and be valid. Else we ignore it by logging a warning

    buildRegistry

    private any buildRegistry(array locations)

    Build the modules registry

    Parameters:
    locations - The array of locations to register

    canLoad

    private boolean canLoad(any moduleName)

    Checks if the module can be loaded or registered

    Parameters:
    moduleName - The module to check

    getLoadedModules

    public array getLoadedModules()

    Get a listing of all loaded modules


    getModuleConfigCache

    public struct getModuleConfigCache()

    Return the loaded module's configuration objects


    getModuleRegistry

    public struct getModuleRegistry()

    Get the discovered module's registry structure


    isModuleActive

    public boolean isModuleActive(any moduleName)

    Check and see if a module has been activated

    Parameters:
    moduleName - The module

    isModuleRegistered

    public any isModuleRegistered(any moduleName)

    Check and see if a module has been registered

    Parameters:
    moduleName - The module

    loadMappings

    public any loadMappings()

    Load all module mappings


    loadModuleConfiguration

    public any loadModuleConfiguration(struct config, any moduleName)

    Load the module configuration object and return it

    Parameters:
    config - The config structure
    moduleName - The module name

    onConfigurationLoad

    public ModuleService onConfigurationLoad()

    Called by loader service when configuration file loads

    Overrides:
    onConfigurationLoad in class BaseService

    onShutdown

    public ModuleService onShutdown()

    Called when the application stops

    Overrides:
    onShutdown in class BaseService

    rebuildModuleRegistry

    public ModuleService rebuildModuleRegistry()

    Rescan the module locations directories and re-register all located modules, this{method does NOT register or activate any modules, it just reloads the found registry


    registerAllModules

    public ModuleService registerAllModules()

    Register all modules for the application. Usually called by framework to load{configuration data.


    registerAndActivateModule

    public any registerAndActivateModule(any moduleName, [any invocationPath=''])

    Register and activate a new module

    Parameters:
    moduleName - The name of the module to load.
    invocationPath - The module's invocation path to its root from the webroot (the instantiation path,ex:myapp.myCustomModules), if empty we use registry location, if not we are doing a explicit name+path registration. Do not include the module name, you passed that in the first argument right

    registerModule

    public boolean registerModule(any moduleName, [any invocationPath=''], [any parent=''], [boolean force='false'])

    Register a module's configuration information and config object

    Parameters:
    moduleName - The name of the module to load.
    invocationPath - The module's invocation path to its root from the webroot (the instantiation path,ex:myapp.myCustomModules), if empty we use registry locatioif not we are doing a explicit name+path registration. Do not include the module name, you passed that in the first argument right
    parent - The name of the parent module
    force - Force a registration

    reload

    public ModuleService reload(any moduleName)

    Reload a targeted module

    Parameters:
    moduleName - The module

    reloadAll

    public ModuleService reloadAll()

    Reload all modules


    scanModulesDirectory

    private any scanModulesDirectory(any dirPath)

    Get an array of modules found and add to the registry structure

    Parameters:
    dirPath - The path to scan

    unload

    public boolean unload(any moduleName)

    Unload a module if found from the configuration

    Parameters:
    moduleName - The module

    unloadAll

    public ModuleService unloadAll()

    Unload all registered modules