Class MessageProcessor<T extends DigitalTwinBase,V>

java.lang.Object
com.scaleoutsoftware.digitaltwin.core.MessageProcessorBase<T>
com.scaleoutsoftware.digitaltwin.core.MessageProcessor<T,V>
Type Parameters:
T - the real type of the DigitalTwinBase
V - the type of messages processed by the real-time digital twin
All Implemented Interfaces:
Serializable

public abstract class MessageProcessor<T extends DigitalTwinBase,V> extends MessageProcessorBase<T> implements Serializable
Processes messages for a real-time digital twin.
See Also:
  • Constructor Details

    • MessageProcessor

      public MessageProcessor()
  • Method Details

    • processMessages

      public abstract ProcessingResult processMessages(ProcessingContext context, T stateObject, Iterable<V> incomingMessages) throws Exception
      Processes a set of incoming messages and determines whether to update the real-time digital twin.
      Parameters:
      context - optional context for processing.
      stateObject - the state object.
      incomingMessages - the incoming messages.
      Returns:
      processing results for updating the state object.
      Throws:
      Exception - if an exception occurs during processing
    • processMessages

      public ProcessingResult processMessages(ProcessingContext context, T twin, MessageFactory factory) throws Exception
      Helper method to ensure proper typing for user methods.
      Specified by:
      processMessages in class MessageProcessorBase<T extends DigitalTwinBase>
      Parameters:
      context - the processing context.
      twin - the digital twin object.
      factory - the message list factory.
      Returns:
      the implementing class's processing result.
      Throws:
      Exception - if an exception occurs during processing.