Class StandaloneRuntime

java.lang.Object
be.kuleuven.cs.distrinet.sparta.cli.runtime.StandaloneRuntime

public final class StandaloneRuntime extends Object
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 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

      public static ResourceSet loadModel(String target)
      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

      public static List<Threat> runThreatAnalysis(String target)
      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

      public static List<Threat> runThreatAnalysis(ResourceSet resourceSet)
      Run a threat analysis on an already-loaded model. Reusing a ResourceSet avoids parsing the same model more than once.
      Parameters:
      resourceSet - the resource set containing the loaded model
      Returns:
      the resulting list of threats