Class PlatformInstantiator.InstantiationConfigurer
- java.lang.Object
-
- de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer
-
- Direct Known Subclasses:
PlatformInstantiator.NonCleaningInstantiationConfigurer
- Enclosing class:
- PlatformInstantiator
public static class PlatformInstantiator.InstantiationConfigurer extends java.lang.ObjectConfigures the instantiation. Default is for command line execution, but the configurer allows for adjusting the execution to jUnit testing.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringivmlModelNameprivate java.io.FilemetaModelFolderprivate java.io.FilemodelFolderprivate java.io.FileoutputFolderprivate java.lang.StringstartRuleName
-
Constructor Summary
Constructors Constructor Description InstantiationConfigurer(java.lang.String ivmlModelName, java.io.File modelFolder, java.io.File outputFolder)Creates a configurer instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancleanOutputFolder()Returns whether the output folder shall be cleaned before code generation.voidconfigure(ConfigurationSetup setup)Configures the platform instantiation via the givenConfigurationSetup.protected java.lang.StringgetStartRuleName()Returns the VIL start rule name.protected voidhandleExecutionException(java.util.concurrent.ExecutionException ex)Handles an instantiation exception.ConfigurationLifecycleDescriptorobtainLifecycleDescriptor()Obtains the lifecycle descriptor.PlatformInstantiator.InstantiationConfigurersetIvmlMetaModelFolder(java.io.File metaModelFolder)Changes the meta model folder.PlatformInstantiator.InstantiationConfigurersetStartRuleName(java.lang.String startRuleName)Optionally sets the start rule name.protected voidvalidateConfiguration(net.ssehub.easy.varModel.confModel.Configuration conf)Validates the configuration after reasoning.protected voidvalidateReasoningResult(net.ssehub.easy.reasoning.core.reasoner.ReasoningResult res)Validates the reasoning result.
-
-
-
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 configurationmodelFolder- 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
-
configure
public void configure(ConfigurationSetup setup)
Configures the platform instantiation via the givenConfigurationSetup.- Parameters:
setup- the setup instance
-
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:
truefor clean,falseelse
-
obtainLifecycleDescriptor
public ConfigurationLifecycleDescriptor obtainLifecycleDescriptor()
Obtains the lifecycle descriptor.- Returns:
- the descriptor
-
validateConfiguration
protected void validateConfiguration(net.ssehub.easy.varModel.confModel.Configuration conf) throws java.util.concurrent.ExecutionExceptionValidates 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.ExecutionExceptionValidates 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.ExecutionExceptionHandles an instantiation exception.- Parameters:
ex- the exception- Throws:
java.util.concurrent.ExecutionException- may re-throw the exception
-
-