Class PlatformInstantiator.InstantiationConfigurer

  • Direct Known Subclasses:
    PlatformInstantiator.NonCleaningInstantiationConfigurer
    Enclosing class:
    PlatformInstantiator

    public static class PlatformInstantiator.InstantiationConfigurer
    extends java.lang.Object
    Configures the instantiation. Default is for command line execution, but the configurer allows for adjusting the execution to jUnit testing.
    Author:
    Holger Eichelberger, SSE
    • Field Detail

      • ivmlModelName

        private java.lang.String ivmlModelName
      • outputFolder

        private java.io.File outputFolder
      • modelFolder

        private java.io.File modelFolder
      • metaModelFolder

        private java.io.File metaModelFolder
      • startRuleName

        private java.lang.String startRuleName
    • Constructor Detail

      • InstantiationConfigurer

        public InstantiationConfigurer​(java.lang.String ivmlModelName,
                                       java.io.File modelFolder,
                                       java.io.File outputFolder)
        Creates a configurer instance.
        Parameters:
        ivmlModelName - the name of the IVML model representing the topmost platform configuration
        modelFolder - the folder where the model is located (ignored if null)
        outputFolder - the output folder for code generation
    • Method Detail

      • setStartRuleName

        public PlatformInstantiator.InstantiationConfigurer setStartRuleName​(java.lang.String startRuleName)
        Optionally sets the start rule name. The default name is "main".
        Parameters:
        startRuleName - the start rule name
        Returns:
        this (builder style)
      • setIvmlMetaModelFolder

        public PlatformInstantiator.InstantiationConfigurer setIvmlMetaModelFolder​(java.io.File metaModelFolder)
        Changes the meta model folder.
        Parameters:
        metaModelFolder - the meta model folder (ignored if null or does not exist)
        Returns:
        the meta model folder
      • getStartRuleName

        protected java.lang.String getStartRuleName()
        Returns the VIL start rule name.
        Returns:
        the VIL start rule name
      • cleanOutputFolder

        protected boolean cleanOutputFolder()
        Returns whether the output folder shall be cleaned before code generation.
        Returns:
        true for clean, false else
      • validateConfiguration

        protected void validateConfiguration​(net.ssehub.easy.varModel.confModel.Configuration conf)
                                      throws java.util.concurrent.ExecutionException
        Validates the configuration after reasoning. May terminate the program or throw an exception.
        Parameters:
        conf - the configuration
        Throws:
        java.util.concurrent.ExecutionException - if the validation fails
      • validateReasoningResult

        protected void validateReasoningResult​(net.ssehub.easy.reasoning.core.reasoner.ReasoningResult res)
                                        throws java.util.concurrent.ExecutionException
        Validates the reasoning result. May terminate the program or throw an exception.
        Parameters:
        res - the reasoning result
        Throws:
        java.util.concurrent.ExecutionException - if reasoning fails
      • handleExecutionException

        protected void handleExecutionException​(java.util.concurrent.ExecutionException ex)
                                         throws java.util.concurrent.ExecutionException
        Handles an instantiation exception.
        Parameters:
        ex - the exception
        Throws:
        java.util.concurrent.ExecutionException - may re-throw the exception