Class StandaloneRuntime
java.lang.Object
be.kuleuven.cs.distrinet.sparta.cli.runtime.StandaloneRuntime
Shared standalone (non-OSGi) SPARTA runtime. Bootstraps EMF and VIATRA outside of an
Eclipse instance, loads SPARTA models and runs the threat analysis. Both the CLI
(
SpartaCli) and the CI runner (SpartaCi) use this one implementation
instead of reaching into each other's command-line plumbing.-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceSetLoad a model from the provided filename.runThreatAnalysis(String target) Run a threat analysis on user-specified model.runThreatAnalysis(ResourceSet resourceSet) Run a threat analysis on an already-loaded model.static voidSetup EMF for running it outside of an eclipse instance.static voidSetup VIATRA for running it outside of an eclipse instance.
-
Method Details
-
setupEMFStandalone
public static void setupEMFStandalone()Setup EMF for running it outside of an eclipse instance. -
setupVIATRAStandalone
public static void setupVIATRAStandalone()Setup VIATRA for running it outside of an eclipse instance. -
loadModel
Load a model from the provided filename. This is a helper method that returns the ResourceSet. It does not run the threat analysis. To load a model and run the threat analysis use runThreatAnalysis.- Parameters:
target- the filename of the model- Returns:
- the ResourceSet with the model.
-
runThreatAnalysis
Run a threat analysis on user-specified model. The model file is retrieved from the cli arguments.- Parameters:
target- the model- Returns:
- the resulting list of threats
-
runThreatAnalysis
Run a threat analysis on an already-loaded model. Reusing aResourceSetavoids parsing the same model more than once.- Parameters:
resourceSet- the resource set containing the loaded model- Returns:
- the resulting list of threats
-