Package org.wicketstuff.nashorn.resource
Class NashornScriptCallable
java.lang.Object
org.wicketstuff.nashorn.resource.NashornScriptCallable
The script callable setup the script environment and evaluates the given script. If the script is
running the thread id is going to be determined. This id is used to check the memory usage of the
process.
- Author:
- Tobias Soloschenko
-
Constructor Summary
ConstructorDescriptionNashornScriptCallable
(String script, IResource.Attributes attributes, org.openjdk.nashorn.api.scripting.ClassFilter classFilter, Writer writer, Writer errorWriter) Creates a script result -
Method Summary
Modifier and TypeMethodDescriptioncall()
Gets the attributesorg.openjdk.nashorn.api.scripting.ClassFilter
Gets the class filterGets the error writerGets the scriptlong
Gets the script callable thread idGets the writerprotected void
setup
(IResource.Attributes attributes, Bindings bindings) Setup the bindings and make information available to the scripting context
-
Constructor Details
-
NashornScriptCallable
public NashornScriptCallable(String script, IResource.Attributes attributes, org.openjdk.nashorn.api.scripting.ClassFilter classFilter, Writer writer, Writer errorWriter) Creates a script result- Parameters:
script
- the script to be executedattributes
- the attributes toclassFilter
- the class filter to be appliedwriter
- the writer to output script printserrorWriter
- the writer to output errors
-
-
Method Details
-
call
-
setup
Setup the bindings and make information available to the scripting context- Parameters:
attributes
- the attributes of the requestbindings
- the bindings to add java objects to
-
getScript
Gets the script- Returns:
- the script
-
getAttributes
Gets the attributes- Returns:
- the attributes
-
getClassFilter
public org.openjdk.nashorn.api.scripting.ClassFilter getClassFilter()Gets the class filter- Returns:
- the class filter
-
getWriter
Gets the writer- Returns:
- the writer
-
getErrorWriter
Gets the error writer- Returns:
- the error writer
-
getThreadId
public long getThreadId()Gets the script callable thread id- Returns:
- the script callable script id
-