Class ModulePackage

java.lang.Object
com.scaleoutsoftware.modules.hosting.ModulePackage

public class ModulePackage extends Object
The ModulePackage class hosts defined msg and api modules.
  • Field Details

    • GRID_CONNECTION

      public static com.scaleout.client.GridConnection GRID_CONNECTION
      A GridConnection to the local ScaleOut grid where this module package is deployed.
  • Constructor Details

    • ModulePackage

      public ModulePackage()
      Instantiate the ModulePackage
  • Method Details

    • addMsgModule

      public <O> void addMsgModule(String moduleName, MessageProcessor<O> processor, MsgModuleOptions<O> options)
      Add a msg module configuration.
      Type Parameters:
      O - the SOSS object type.
      Parameters:
      moduleName - the msg module name.
      processor - the MessageProcessor.
      options - the MsgModuleOptions
    • addApiModule

      public <O> void addApiModule(String moduleName, ApiProcessor<O> processor, ApiModuleOptions<O> options)
      Add an API module configuration.
      Type Parameters:
      O - the SOSS object type.
      Parameters:
      moduleName - the api module name.
      processor - an instance of the API processor implementation
      options - the API module options
    • addDigitalTwinModel

      public <O extends com.scaleoutsoftware.digitaltwin.abstractions.DigitalTwinBase<O>> void addDigitalTwinModel(String modelName, com.scaleoutsoftware.digitaltwin.abstractions.MessageProcessor<O> processor, DigitalTwinModelOptions<O> options)
      Add a Digital Twin model configuration.
      Type Parameters:
      O - the type of the digital twin.
      Parameters:
      modelName - the digital twin model name
      processor - the Digital Twin message processor
      options - the digital twin module options
    • addSimulationDigitalTwinModel

      public <O extends com.scaleoutsoftware.digitaltwin.abstractions.DigitalTwinBase<O>> void addSimulationDigitalTwinModel(String modelName, com.scaleoutsoftware.digitaltwin.abstractions.MessageProcessor<O> messageProcessor, com.scaleoutsoftware.digitaltwin.abstractions.SimulationProcessor<O> simulationProcessor, DigitalTwinModelOptions<O> options)
      Add a Digital Twin model configuration.
      Type Parameters:
      O - the type of the digital twin.
      Parameters:
      modelName - the digital twin model name.
      messageProcessor - the Digital Twin message processor.
      simulationProcessor - the Digital Twin simulation processor.
      options - the digital twin module options.
    • waitForEvents

      public void waitForEvents() throws ModuleRegistrationException
      This ModulePackage will block indefinitely and wait for events. If an invalid module is found, a ModuleRegistrationException will be thrown.
      Throws:
      ModuleRegistrationException - if an invalid module is found, or a connection to the underlying ScaleOut service cannot be found or created, or if this method is called from outside the scope of an InvocationWorker.
    • runLocalDevelopmentEnvironment

      public void runLocalDevelopmentEnvironment() throws ModuleRegistrationException
      This ModulePackage will block indefinitely and wait for events with a local ScaleOut StateServer installation. If an invalid module is found, a ModuleRegistrationException will be thrown.
      Throws:
      ModuleRegistrationException - if an invalid module is found, or a connection to the underlying ScaleOut service cannot be found or created, or this method is called outside the scope of local, single host testing.