public class Rhino extends Object implements JavascriptEngine<org.mozilla.javascript.Context>
Constructor and Description |
---|
Rhino() |
Modifier and Type | Method and Description |
---|---|
void |
closeRuntime()
Closes the runtime for the specified engine
|
Object |
executeFunction(String name,
Object... parameters)
Executes a javascript function and returns the result of that function
|
void |
executeScript(String script)
Read the functions of a given javascript file
|
org.mozilla.javascript.Context |
getEngine()
Getter for the runtime of the specified engine
|
void |
registerCallback(ISender sender,
PipeLineSession session)
Only used by J2V8, allows for senders to be called by the javascript function.
|
void |
setGlobalAlias(String alias) |
void |
setResultHandler(ResultHandler resultHandler)
Registers the result and error functions to be handled by the given result handler.
|
void |
startRuntime()
Initialize the runtime for the specified engine
|
public void setGlobalAlias(String alias)
setGlobalAlias
in interface JavascriptEngine<org.mozilla.javascript.Context>
alias
- An identifier which describes the script(s) that are being executed.public void startRuntime()
JavascriptEngine
startRuntime
in interface JavascriptEngine<org.mozilla.javascript.Context>
public void executeScript(String script) throws JavascriptException
JavascriptEngine
executeScript
in interface JavascriptEngine<org.mozilla.javascript.Context>
script
- String containing the contents of the javascript file in which the function(s) to be executed are specified.JavascriptException
public Object executeFunction(String name, Object... parameters) throws JavascriptException
JavascriptEngine
executeFunction
in interface JavascriptEngine<org.mozilla.javascript.Context>
name
- The name of the javascript function as given in the javascript file.parameters
- An array containing the parameters for the javascript function, given in the adapter configurationJavascriptException
public void closeRuntime()
JavascriptEngine
closeRuntime
in interface JavascriptEngine<org.mozilla.javascript.Context>
public org.mozilla.javascript.Context getEngine()
JavascriptEngine
getEngine
in interface JavascriptEngine<org.mozilla.javascript.Context>
public void registerCallback(ISender sender, PipeLineSession session)
JavascriptEngine
registerCallback
in interface JavascriptEngine<org.mozilla.javascript.Context>
sender
- The sender given in the adapter configurationpublic void setResultHandler(ResultHandler resultHandler)
JavascriptEngine
setResultHandler
in interface JavascriptEngine<org.mozilla.javascript.Context>
resultHandler
- Object to handle results and errors.Copyright © 2023 Frank!Framework. All rights reserved.