Open the menu

    Module Lifecycle Callbacks

    LumisXP has two module callbacks to control the creation and elimination of resources that should exist during the execution of the module (that is, resources that must exist while the module is available in the LumisXP classloader).

    The first callback is called before the module is removed from the LumisXP classloader. To do this, you simply need to have a class with a method annotated with lumis.portal.deployment.lifecycle.BeforeClassLoaderStop.
    This method will then be called before the module is removed from the LumisXP classloader.

    The second callback is called after the module is added to the LumisXP classloader. To do this, you just need to have a class with a method annotated with lumis.portal.deployment.lifecycle.AfterClassLoaderStarted.
    This method will then be called after the module is added to the LumisXP classloader.

    It is important to emphasize that there are dependencies between LumisXP's classloaders. All isolated modules, for example, must be re-added to the LumisXP classloader if a global module is being deployed.
    In this case, the callbacks BeforeClassLoaderStop and AfterClassLoaderStarted will be called in isolated modules, even if they are not directly involved in the deployment.

    It is also worth noting that there may be a delay between the BeforeClassLoaderStop and AfterClassLoaderStarted callbacks being executed.