Package org.wicketstuff.nashorn.resource
Class NashornScriptCallable
- java.lang.Object
-
- org.wicketstuff.nashorn.resource.NashornScriptCallable
-
public class NashornScriptCallable extends Object implements Callable<Object>
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
Constructors Constructor Description NashornScriptCallable(String script, IResource.Attributes attributes, ClassFilter classFilter, Writer writer, Writer errorWriter)
Creates a script result
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
call()
IResource.Attributes
getAttributes()
Gets the attributesClassFilter
getClassFilter()
Gets the class filterWriter
getErrorWriter()
Gets the error writerString
getScript()
Gets the scriptlong
getThreadId()
Gets the script callable thread idWriter
getWriter()
Gets the writerprotected void
setup(IResource.Attributes attributes, Bindings bindings)
Setup the bindings and make information available to the scripting context
-
-
-
Constructor Detail
-
NashornScriptCallable
public NashornScriptCallable(String script, IResource.Attributes attributes, 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 Detail
-
setup
protected void setup(IResource.Attributes attributes, Bindings bindings)
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
public String getScript()
Gets the script- Returns:
- the script
-
getAttributes
public IResource.Attributes getAttributes()
Gets the attributes- Returns:
- the attributes
-
getClassFilter
public ClassFilter getClassFilter()
Gets the class filter- Returns:
- the class filter
-
getWriter
public Writer getWriter()
Gets the writer- Returns:
- the writer
-
getErrorWriter
public 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
-
-