Interface IModuleBase<T extends ModuleConfigBase>

All Known Subinterfaces:
IClientModule<ConfigType>, ICommNetwork<ConfigType>, ICommProvider<ConfigType>, IDataProducerModule<ConfigType>, IHttpServer<T>, IMessageQueuePush<T>, IModule<T>, IObsSystemDatabaseModule<ConfigType>, IProcessModule<ConfigType>, ISensorModule<ConfigType>, IServiceModule<ConfigType>, ISubModule<T>

public interface IModuleBase<T extends ModuleConfigBase>

Base interface for main modules and submodules

Since:
Feb 28, 2025
  • Method Details

    • init

      void init(T config) throws SensorHubException
      Initializes the module with the specified configuration.
      This is equivalent to calling #setConfiguration(ModuleConfig) and then #init() with no arguments.
      Parameters:
      config -
      Throws:
      SensorHubException - if an error occurs during synchronous execution. If an error occurs asynchronously, it can be retrieved with #getCurrentError()
    • start

      void start() throws SensorHubException
      Requests the module to start.
      Implementations of this method can be synchronous or asynchronous, but when this method returns without error, the module state is guaranteed to be either ModuleEvent.ModuleState.STARTING or ModuleEvent.ModuleState.STARTED.
      Module should be in ModuleEvent.ModuleState.INITIALIZED state before calling this method.
      Throws:
      SensorHubException - if an error occurs during synchronous execution. If an error occurs asynchronously, it can be retrieved with #getCurrentError()
    • stop

      void stop() throws SensorHubException
      Requests the module to stop.
      Implementations of this method can be synchronous or asynchronous, but when this method returns without error, the module state is guaranteed to be either ModuleEvent.ModuleState.STOPPING or ModuleEvent.ModuleState.STOPPED.
      Throws:
      SensorHubException - if an error occurs during synchronous execution. If an error occurs asynchronously, it can be retrieved with #getCurrentError()
    • getConfiguration

      T getConfiguration()
      Retrieves a copy of the module configuration (i.e. for reading only since changes won't have any effect until updateConfig is called)
      Returns:
      a copy of the configuration object associated to this module
    • getName

      String getName()
      Helper method to get the module's name
      Returns:
      name string