Interface ModelAccessProvider

All Known Subinterfaces:
ConnectorInputTypeTranslator<T,S>, ConnectorOutputTypeTranslator<S,T>
All Known Implementing Classes:
AbstractConnectorInputTypeTranslator, AbstractConnectorOutputTypeTranslator, ChanneledConnectorOutputTypeAdapter, ConnectorInputTypeAdapter, ConnectorOutputTypeAdapter

public interface ModelAccessProvider
Refines the TypeTranslator for the use with machine connectors.
Author:
Holger Eichelberger, SSE
  • Method Details

    • getModelAccess

      ModelAccess getModelAccess()
      Returns the model access instance to be used during type translations.
      Returns:
      the model access instance, may be null (see MachineConnector.hasModel())
    • setModelAccess

      void setModelAccess(ModelAccess modelAccess)
      Defines the model access. Handle with care, shall be called (indirectly) by the connector only.
      Parameters:
      modelAccess - the model access
    • optional

      static boolean optional(ModelAccess modelAccess, ModelAccessProvider.IOVoidFunction func)
      Executes func but consumes IOException as execution is considered optional.
      Parameters:
      modelAccess - the model access to be passed into func
      func - the function to execute
      Returns:
      true for success without exception, false for failed with caught exception
    • optionalStep

      static ModelAccess optionalStep(ModelAccess modelAccess, ModelAccessProvider.IOModelAccessFunction func)
      Executes func but consumes IOException as execution is considered optional.
      Parameters:
      modelAccess - the model access to be passed into func
      func - the function to execute
      Returns:
      modelAccess or some nested model access function to continue with