|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.schmant.app.jython.JythonExecutor
public final class JythonExecutor
This script executor runs Jython build scripts.
JythonExecutorFactory| Constructor Summary | |
|---|---|
JythonExecutor()
|
|
| 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? |
|
void |
postEnable(TaskPackage tp,
Report r)
This method is called just after the task package has enabled itself. |
|
void |
preEnable(TaskPackage tp,
Report r)
This method is called just before the task package enables itself. |
|
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 |
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 JythonExecutor()
| Method Detail |
|---|
public void init(NamedReadableFile scriptFile,
LauncherSettings ls,
Report r)
throws IOException
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.
IOExceptionScriptExecutor.tearDown()public void tearDown()
ScriptExecutorScriptExecutor.init(NamedReadableFile, LauncherSettings, Report) registered
with.
tearDown in interface ScriptExecutor
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 SchmantException,
IOException
ScriptExecutor
runPreparationScript in interface ScriptExecutorscript - The script file.r - A report to log to.
SchmantException - On errors.
IOException
public Object runWithDefaultWrapperScript()
throws SchmantException,
IOException
ScriptExecutor
runWithDefaultWrapperScript in interface ScriptExecutorSchmantException - On errors.
IOException
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 void postEnable(TaskPackage tp,
Report r)
TaskPackageEnableCallback
postEnable in interface TaskPackageEnableCallbacktp - The task package.r - The current report.
public void preEnable(TaskPackage tp,
Report r)
TaskPackageEnableCallback
preEnable in interface TaskPackageEnableCallbacktp - The task package.r - The current report.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 | ||||||||