Interface Module

  • All Superinterfaces:
    ModuleInfo
    All Known Implementing Classes:
    AbstractModule

    public interface Module
    extends ModuleInfo
    A module encapsulates optional functionality within a project. Modules can be used as an easy way to make projects more configurable.

    The module system provides a controled way to check dependencies and to initialize the modules in a controlled way.

    Author:
    Thomas Morgner
    • Method Detail

      • getRequiredModules

        ModuleInfo[] getRequiredModules()
        Returns an array of all required modules. If one of these modules is missing or cannot be initialized, the module itself will be not available.
        Returns:
        an array of the required modules.
      • getOptionalModules

        ModuleInfo[] getOptionalModules()
        Returns an array of optional modules. Missing or invalid modules are non fatal and will not harm the module itself.
        Returns:
        an array of optional module specifications.
      • initialize

        void initialize​(SubSystem subSystem)
                 throws ModuleInitializeException
        Initializes the module. Use this method to perform all initial setup operations. This method is called only once in a modules lifetime. If the initializing cannot be completed, throw a ModuleInitializeException to indicate the error,. The module will not be available to the system.
        Parameters:
        subSystem - the subSystem.
        Throws:
        ModuleInitializeException - if an error ocurred while initializing the module.
      • configure

        void configure​(SubSystem subSystem)
        Configures the module. This should load the default settings of the module.
        Parameters:
        subSystem - the subSystem.
      • getDescription

        String getDescription()
        Returns a short description of the modules functionality.
        Returns:
        a module description.
      • getProducer

        String getProducer()
        Returns the name of the module producer.
        Returns:
        the producer name
      • getName

        String getName()
        Returns the module name. This name should be a short descriptive handle of the module.
        Returns:
        the module name
      • getSubSystem

        String getSubSystem()
        Returns the modules subsystem. If this module is not part of an subsystem then return the modules name, but never null.
        Returns:
        the name of the subsystem.