Options
All
  • Public
  • Public/Protected
  • All
Menu

ModuleManager provides some basic module management functionality, tracking and instantiating module instances. A global ModuleManager instance lives in the base geocortex namespace.

Hierarchy

  • ModuleManager

Index

Constructors

constructor

  • Initializes a new instance of the {@link geocortex.framework.application.ModuleManager} class.

    Parameters

    • app: Application

      The {@link geocortex.framework.application.Application} that this module belongs to.

    Returns ModuleManager

Properties

Protected _modules

_modules: object

The modules managed by this instance.

Type declaration

  • [moduleName: string]: any

app

The {@link geocortex.framework.application.Application} that this module manager belongs to.

Methods

hasModule

  • hasModule(moduleName: string): boolean
  • Check for the existence of a module in configuration

    Parameters

    • moduleName: string

    Returns boolean

instantiate

  • instantiate(moduleTypeName: string, libraryId: string): any
  • Creates an instance of a module by its type name.

    Parameters

    • moduleTypeName: string

      The type name of the module to instantiate.

    • libraryId: string

      The ID of the library that this module belongs to.

    Returns any

markModuleLoaded

  • markModuleLoaded(moduleName: string, moduleInstance: ModuleBase): void
  • Marks a module as being loaded.

    Parameters

    • moduleName: string

      The configured name of the module to instantiate.

    • moduleInstance: ModuleBase

      The instance of the module to be loaded.

    Returns void

moduleIsLoaded

  • moduleIsLoaded(moduleName: string): boolean
  • Checks if a module has been loaded or not.

    Parameters

    • moduleName: string

      The configured name of the module to check for.

    Returns boolean

notifyModuleLoaded

  • notifyModuleLoaded(moduleName: string, notificationCallback: function): void
  • Notifies if/when a module is loaded. If the module is already loaded, the supplied callback is fired immediately. If the module has not yet been loaded, the callback will be fired when it becomes loaded. Take care to avoid using this method unless it is absolutely required, as it can introduce unnecessary coupling between modules.

    Parameters

    • moduleName: string

      The configured name of the module to notify for.

    • notificationCallback: function

      The callback to fire if/when the module is loaded.

        • (moduleName: string): void
        • Parameters

          • moduleName: string

          Returns void

    Returns void

shutdown

  • shutdown(state: any): void
  • Shuts down the module manager, calling "shutdown" on all loaded modules and removing them from the managed collection.

    Parameters

    • state: any

      Custom shutdown related state (such as an exception) to pass to each module via shutdown().

    Returns void