Class ModulePackage
java.lang.Object
com.scaleoutsoftware.modules.hosting.ModulePackage
The ModulePackage class hosts defined msg and api modules.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic com.scaleout.client.GridConnectionA GridConnection to the local ScaleOut grid where this module package is deployed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<O> voidaddApiModule(String moduleName, ApiProcessor<O> processor, ApiModuleOptions<O> options) Add an API module configuration.<O extends com.scaleoutsoftware.digitaltwin.abstractions.DigitalTwinBase<O>>
voidaddDigitalTwinModel(String modelName, com.scaleoutsoftware.digitaltwin.abstractions.MessageProcessor<O> processor, DigitalTwinModelOptions<O> options) Add a Digital Twin model configuration.<O> voidaddMsgModule(String moduleName, MessageProcessor<O> processor, MsgModuleOptions<O> options) Add a msg module configuration.<O extends com.scaleoutsoftware.digitaltwin.abstractions.DigitalTwinBase<O>>
voidaddSimulationDigitalTwinModel(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.voidThisModulePackagewill block indefinitely and wait for events with a local ScaleOut StateServer installation.voidThisModulePackagewill block indefinitely and wait for events.
-
Field Details
-
GRID_CONNECTION
public static com.scaleout.client.GridConnection GRID_CONNECTIONA 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- theMessageProcessor.options- theMsgModuleOptions
-
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 implementationoptions- 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 nameprocessor- the Digital Twin message processoroptions- 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
ThisModulePackagewill block indefinitely and wait for events. If an invalid module is found, aModuleRegistrationExceptionwill 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 anInvocationWorker.
-
runLocalDevelopmentEnvironment
ThisModulePackagewill block indefinitely and wait for events with a local ScaleOut StateServer installation. If an invalid module is found, aModuleRegistrationExceptionwill 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.
-