Class ScriptService

java.lang.Object
com.persequor.saga.modules.scripting.service.ScriptService

@Singleton public class ScriptService extends Object
This class provides scripting module operations.
  • Constructor Details

    • ScriptService

      @Inject public ScriptService(ScriptModuleContextWrapper contextWrapper, com.persequor.extension.common.IInjector injector)
  • Method Details

    • initialScriptCode

      public String initialScriptCode(String language, Class<?> epInterface, ScriptFile scriptFile)
      Retrieve the initial code for a given script interface.
      Parameters:
      language - that initial code is fetched.
      epInterface - - the type of extension point interface.
      Returns:
      initial code.
    • checkSyntax

      public void checkSyntax(ScriptFile script) throws InvalidScriptException
      Validate syntax of a given script file.
      Parameters:
      script - - the validated script file
      Throws:
      InvalidScriptException - - if the script is invalid.
    • getExtension

      public <T> T getExtension(ScriptFile script, Class<T> extensionType)
      Retrieve the extension from the script file.
      Type Parameters:
      T - the class of returned extension.
      Parameters:
      script - - the script file.
      extensionType - - the type of returned extension.
      Returns:
      the extension.