Interface ModuleComponent

  • All Known Implementing Classes:
    AbstractModuleComponent, ImporterModuleComponent, LoggerModuleComponent

    @AlfrescoPublicApi
    public interface ModuleComponent
    Interface for classes that control the startup and shutdown behaviour of modules.

    Note that the execution order of these components is on the basis of dependencies only. The version numbering determines only whether a component will be executed and doesn't imply any ordering.

    Equals and Hashcode method must be implemented.

    Since:
    2.0
    Author:
    Derek Hulley
    • Method Detail

      • getModuleId

        java.lang.String getModuleId()
        Returns:
        Returns the globally unique module ID.
      • getName

        java.lang.String getName()
        Returns:
        Returns the name of the component in the context of the module ID. It does not have to be globally unique.
      • getDescription

        java.lang.String getDescription()
        Returns:
        Returns a description of the component.
      • getSinceVersionNumber

        ModuleVersionNumber getSinceVersionNumber()
        Returns:
        Returns the version number of the module for which this component was introduced.
      • getAppliesFromVersionNumber

        ModuleVersionNumber getAppliesFromVersionNumber()
        Returns:
        Returns the smallest version number of the module to which this component applies.
      • getAppliesToVersionNumber

        ModuleVersionNumber getAppliesToVersionNumber()
        Returns:
        Returns the largest version number of the module to which this component applies.
      • getDependsOn

        java.util.List<ModuleComponent> getDependsOn()
        A list of module components that must be executed prior to this instance. This is the only way to guarantee ordered execution. The dependencies may include components from other modules, guaranteeing an early failure if a module is missing.
        Returns:
        Returns a list of components that must be executed prior to this component.
      • isExecuteOnceOnly

        boolean isExecuteOnceOnly()
        Returns:
        Returns true if the component is to be successfully executed exactly once, or false if the component must be executed with each startup.
      • execute

        void execute()
        Perform the actual component's work. Execution will be done within the context of a system account with an enclosing transaction. Long-running processes should be spawned from the calling thread, if required.

        All failures should just be thrown out as runtime exceptions and will be dealt with by the associated module infrastructure.

      • shutdown

        void shutdown()
        Perform any cleanup required to remove module.