|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.schmant.app.js.SunJavaScriptExecutor
public final class SunJavaScriptExecutor
This script executor runs JavaScript build scripts using the JavaScript support bundled in Sun JDK 6+.
| Constructor Summary | |
|---|---|
SunJavaScriptExecutor()
|
|
| Method Summary | ||
|---|---|---|
void |
init(NamedReadableFile scriptFile,
LauncherSettings ls,
Report r)
Initialize the script executor. |
|
boolean |
isClosure(Object o)
Is the object a closure that can be run? |
|
Runnable |
proxyRunnable(Runnable r)
Proxy the Runnable that the thread is configured to run with a
runnable that sets up the thread context. |
|
Object |
runClosure(Object closure,
Object... arguments)
Run the closure and return the result. |
|
void |
runDefaultPreparationScript(Report r)
Run the default environment preparation script. |
|
void |
runPreparationScript(File script,
Report r)
Run the preparation script in the file. |
|
Object |
runScriptFromFile(Object f)
|
|
Object |
runWithDefaultWrapperScript()
Run the script using the default wrapper script, if any. |
|
void |
setBindings(Bindings bnd,
int scope)
Set the variables stored in the bindings in the specified scope. |
|
void |
setGlobalVariable(String name,
Object value)
Set the value of a global variable in the script. |
|
void |
tearDown()
Tear down the script executor when Schmant terminates. |
|
|
tryAdd(FlatteningList<T> list,
int index,
Object o,
ObjectTransformer<T> transformer)
If o is an object that this decorator handles, add it to the
list. |
|
|
tryAdd(FlatteningList<T> list,
int index,
T o)
If o is an object that this decorator handles, add it to the
list. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SunJavaScriptExecutor()
| Method Detail |
|---|
public void init(NamedReadableFile scriptFile,
LauncherSettings ls,
Report r)
ScriptExecutorFlatteningList.registerDecorator(org.schmant.support.util.FlatteningListDecorator),
TaskExecutorThreadFactory.registerThreadContextInitializer(org.schmant.run.ThreadContextInitializer)
and
ClosureSupport.registerClosureRunner(org.schmant.lang.ClosureRunner).
init in interface ScriptExecutorscriptFile - The script file that is run.ls - The command line settings.r - The report.ScriptExecutor.tearDown()public void tearDown()
ScriptExecutorScriptExecutor.init(NamedReadableFile, LauncherSettings, Report) registered
with.
tearDown in interface ScriptExecutor
public Object runScriptFromFile(Object f)
throws IOException
IOException
public void runDefaultPreparationScript(Report r)
throws IOException
ScriptExecutor
runDefaultPreparationScript in interface ScriptExecutorr - A report to log to.
IOException
public void runPreparationScript(File script,
Report r)
throws IOException
ScriptExecutor
runPreparationScript in interface ScriptExecutorscript - The script file.r - A report to log to.
IOException
public Object runWithDefaultWrapperScript()
throws IOException
ScriptExecutor
runWithDefaultWrapperScript in interface ScriptExecutorIOException
public void setBindings(Bindings bnd,
int scope)
ScriptExecutor
setBindings in interface ScriptExecutorbnd - The bindings containing a map of variables to set.scope - The scope to set the variables in. See
ScriptContext. For now this parameter can be
ignored and all variables set to the global scope.
public void setGlobalVariable(String name,
Object value)
ScriptExecutor
setGlobalVariable in interface ScriptExecutorname - The name of the variable.value - The variable value.
public <T> int tryAdd(FlatteningList<T> list,
int index,
T o)
FlatteningListDecoratoro is an object that this decorator handles, add it to the
list.
tryAdd in interface FlatteningListDecoratorT - The type of objects in the list.list - The list to add the object to.index - The index for the new object in the list. If this argument
is -1, add the object to the end of the list.o - The object to add.
-1.
public <T> int tryAdd(FlatteningList<T> list,
int index,
Object o,
ObjectTransformer<T> transformer)
FlatteningListDecoratoro is an object that this decorator handles, add it to the
list.
tryAdd in interface FlatteningListDecoratorT - The type of objects in the list.list - The list to add the object to.index - The index for the new object in the list. If this argument
is -1, add the object to the end of the list.o - The object to add.transformer - The transformer used to transform the object into the
list's type before it is added.
-1.public Runnable proxyRunnable(Runnable r)
ThreadContextInitializerRunnable that the thread is configured to run with a
runnable that sets up the thread context.
proxyRunnable in interface ThreadContextInitializerr - The runnable that the thread is configured to run.
public boolean isClosure(Object o)
ClosureRunner
isClosure in interface ClosureRunnero - The object.
true if the object is a closure.
public Object runClosure(Object closure,
Object... arguments)
throws SchmantException
ClosureRunner
runClosure in interface ClosureRunnerclosure - The closure to run.arguments - Arguments to the closure.
PyObject.
SchmantException - On errors.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||