Package org.eclipse.scanning.api.script
Interface IScriptService
- All Known Implementing Classes:
GDAJythonScriptService
public interface IScriptService
A service to run scripts, python, javascript, r etc.
This service may be backed by a custom engine which supports a subset
of the scripting languages. It might be implemented by an OSGi Jython
or by an eclipse EASE environment.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAborts any currently executing scripts.voidexecute(ScriptRequest req) Execute a script on the server.voidsetNamedValue(String name, Object value) Sets the variable with the given name to the given value, if the implementation supports this.For DAQ server version 8 and 9 this will probably be {JYTHON, SPEC_PASTICHE}
-
Field Details
-
VAR_NAME_SCAN_BEAN
- See Also:
-
VAR_NAME_SCAN_REQUEST
- See Also:
-
VAR_NAME_SCAN_REQUEST_JSON
- See Also:
-
VAR_NAME_SCAN_MODEL
- See Also:
-
VAR_NAME_SCAN_PATH
- See Also:
-
VAR_NAME_CUSTOM_PARAMS
- See Also:
-
-
Method Details
-
supported
ScriptLanguage[] supported()For DAQ server version 8 and 9 this will probably be {JYTHON, SPEC_PASTICHE}- Returns:
- the available supported scripting languages that this service can execute.
-
setNamedValue
Sets the variable with the given name to the given value, if the implementation supports this.- Parameters:
name- namevalue- value
-
execute
Execute a script on the server. This can be used for instance inside scanning to run a script before and after a scan.- Parameters:
req- the script request- Throws:
UnsupportedLanguageException- if the script language specified byScriptRequest.getLanguage()is not supported by this script service.ScriptExecutionException- if an error occurred running the script
-
abortScripts
void abortScripts()Aborts any currently executing scripts.
-