Class ModuleManager

java.lang.Object
com.chillycheesy.modulo.modules.ModuleManager

public class ModuleManager extends Object
Contains and manages all the Module of HomeTracker
  • Constructor Details

    • ModuleManager

      public ModuleManager()
  • Method Details

    • getModule

      public Module getModule(String name) throws HTModuleNotFoundException
      Get a module using the name of the module
      Parameters:
      name - name of the module you want to get
      Returns:
      the module having the name passed in parameters
      Throws:
      HTModuleNotFoundException - if the module you want is not int the modules manager
    • getModule

      public Module getModule(Class<? extends Module> moduleClass) throws HTModuleNotFoundException
      Works like getModule(String) but by passing the class of the module
      Parameters:
      moduleClass - class of the wanted module
      Returns:
      the module being from the class passed in parameter
      Throws:
      HTModuleNotFoundException - if the module you want is not int the modules manager
    • containsModule

      public boolean containsModule(Module module)
      Check if a module is currently in the manager
      Parameters:
      module - module you want to check
      Returns:
      true if the manager contains the module, false if it doesn't
    • containsModule

      public boolean containsModule(String name)
      Works like containsModule(Module) but by passing the name of the module
      Parameters:
      name - name of the module you want to check
      Returns:
      true if the manager contains a module with this name, false if it doesn't
    • containsModule

      public boolean containsModule(Class<? extends Module> moduleClass)
      Works like containsModule(Module) and containsModule(String) but by passing the class of the module
      Parameters:
      moduleClass - class of the module
      Returns:
      true if the manager contains a module of this class, false if it doesn't
    • stopAllModules

      public void stopAllModules()
      Method that stop all Module.
      It will invoke the stopModule(Module) method.
    • stopModules

      public void stopModules(List<Module> modules)
      Method that stop all Module.
      It will invoke the stopModule(Module) method.
      Parameters:
      modules - modules you want to stop
    • stopModule

      public void stopModule(Module module)
      It stops a module, removes it from the ModuleManager
      Parameters:
      module - module you want to stop
    • getModuleCount

      public int getModuleCount()
      Get the number of module currently managed by the manager
      Returns:
      the number of module
    • getModulesCopy

      public List<Module> getModulesCopy()
      Get the started modules.
      Returns:
      a copy of started modules.