Package org.csstudio.opibuilder.script
Class JavaScriptStore
java.lang.Object
org.csstudio.opibuilder.script.AbstractScriptStore
org.csstudio.opibuilder.script.JavaScriptStore
- All Implemented Interfaces:
IScriptStore
This is the implementation of
AbstractScriptStore
using the Nashorn script engine.-
Field Summary
Fields inherited from class org.csstudio.opibuilder.script.AbstractScriptStore
SCRIPT_LIBRARIES
-
Constructor Summary
ConstructorDescriptionJavaScriptStore
(ScriptData scriptData, AbstractBaseEditPart editpart, IPV[] pvArray) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
bootstrapScriptEngine
(ScriptEngine engine, Bindings bindings) protected void
Compile InputStream with script engine.protected void
compileString
(String string) protected void
execScript
(IPV triggerPV) Execute the script with script engine.protected void
Methods inherited from class org.csstudio.opibuilder.script.AbstractScriptStore
dispose, getAbsoluteScriptPath, getDisplayEditPart, getEditPart, getPvArray, getScriptData, unRegister
-
Constructor Details
-
JavaScriptStore
public JavaScriptStore(ScriptData scriptData, AbstractBaseEditPart editpart, IPV[] pvArray) throws Exception - Throws:
Exception
-
-
Method Details
-
initScriptEngine
- Specified by:
initScriptEngine
in classAbstractScriptStore
- Throws:
Exception
-
bootstrapScriptEngine
public static void bootstrapScriptEngine(ScriptEngine engine, Bindings bindings) throws IOException, ScriptException - Throws:
IOException
ScriptException
-
compileString
- Specified by:
compileString
in classAbstractScriptStore
- Throws:
Exception
-
compileInputStream
Description copied from class:AbstractScriptStore
Compile InputStream with script engine. The stream will be closed by this method.- Specified by:
compileInputStream
in classAbstractScriptStore
- Throws:
Exception
-
execScript
Description copied from class:AbstractScriptStore
Execute the script with script engine.- Specified by:
execScript
in classAbstractScriptStore
- Parameters:
triggerPV
- the PV that triggers this execution.- Throws:
Exception
-