public interface NodeRuntime extends GenericNodeRuntime
| Modifier and Type | Method and Description |
|---|---|
void |
enqueueCallback(org.mozilla.javascript.Function f,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
Object[] args)
Put a task on the tick queue to run the specified function in the specified scope.
|
void |
enqueueCallback(org.mozilla.javascript.Function f,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
Object domain,
Object[] args)
Put a task on the tick queue to run the specified function in the specified scope.
|
void |
enqueueTask(ScriptTask task)
Put a task on the tick queue to be run in the main script thread.
|
void |
enqueueTask(ScriptTask task,
Object domain)
Put a task on the tick queue to be run in the main script thread.
|
NodeEnvironment |
getEnvironment()
Return the Environment used to create this script.
|
Sandbox |
getSandbox()
Return the sandbox used to limit script execution, or null if none was set
|
NodeScript |
getScriptObject()
Return the "NodeScript" used to create this script.
|
Object |
require(String modName,
org.mozilla.javascript.Context cx)
Just like "require" in the regular "module" code, it returns the export object for the named module.
|
String |
reverseTranslatePath(String path)
Given a file path, return what the path would be within the Node environment.
|
File |
translatePath(String path)
Given a file path, return a File object that represents the actual file to open.
|
createTimedTask, executeScriptTask, getAsyncPool, getDomain, getNetworkPolicy, getSelector, getUnboundedPool, pin, registerCloseable, unPin, unregisterCloseableNodeEnvironment getEnvironment()
NodeScript getScriptObject()
Sandbox getSandbox()
Object require(String modName, org.mozilla.javascript.Context cx)
void enqueueTask(ScriptTask task)
void enqueueTask(ScriptTask task, Object domain)
void enqueueCallback(org.mozilla.javascript.Function f,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
Object[] args)
f - Function to callscope - the scope where the function should runthisObj - the value of "this" where the function should run, or nullargs - arguments for the function, or nullvoid enqueueCallback(org.mozilla.javascript.Function f,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
Object domain,
Object[] args)
f - Function to callscope - the scope where the function should runthisObj - the value of "this" where the function should run, or nulldomain - the domain where this callback should run -- should set to the current domainargs - arguments for the function, or nullFile translatePath(String path)
String reverseTranslatePath(String path) throws IOException
IOExceptionCopyright © 2016 Apigee Corporation. All Rights Reserved.