|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.figure8.join.services.scripting.ScriptLauncher org.figure8.join.services.scripting.ant.AntScriptLauncher
public class AntScriptLauncher
Extension of ScriptLauncher
dedicated to the Apache Ant build
tool (see http://ant.apache.org). This implementation lets you wrap the
execution of an Ant script within a ScriptLauncher.
As a Configurable
implementation, this
launcher defines 2 more configurable parameters that are the build file
target to execute and the log level to apply onto the logger build listener.
Configurable
Field Summary | |
---|---|
static java.lang.String |
LOG_LEVEL_PARAM
Name of configurable parameter denoting the log level of script execution. |
protected static ParameterDefinition |
logLevelParam
ParameterDefinition representation of parameter denoting the log level of execution. |
protected static java.util.List |
parameters
List of ParameterDefinition s supported by this launcher |
static java.lang.String |
TARGET_PARAM
Name of configurable parameter denoting the target to execute in Ant script. |
protected static ParameterDefinition |
targetParam
ParameterDefinition representation of parameter denoting the target to execute. |
Fields inherited from class org.figure8.join.services.scripting.ScriptLauncher |
---|
SCRIPT_PARAM, scriptParam |
Constructor Summary | |
---|---|
AntScriptLauncher()
Create a new instance of AntScriptLauncher. |
|
AntScriptLauncher(java.lang.String scriptPath)
Creates a new instance of AntScriptLauncher with script path |
Method Summary | |
---|---|
java.lang.String |
getLogLevel()
|
java.util.List |
getParameterDefinitionsAsList()
Get this object parameters definitions as a list |
java.lang.String |
getTarget()
|
void |
runScript(java.util.Properties properties)
Run the Ant build file identified by scriptPath inner
field. |
void |
setLogLevel(java.lang.String logLevel)
|
void |
setParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Set the value of a parameter using its nama |
void |
setTarget(java.lang.String target)
|
Methods inherited from class org.figure8.join.services.scripting.ScriptLauncher |
---|
getLogOutputStream, getParameterDefinitions, getScript, getScriptPath, setLogOutputStream, setParameter, setParameters, setScriptPath |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TARGET_PARAM
public static final java.lang.String LOG_LEVEL_PARAM
protected static java.util.List parameters
ParameterDefinition
s supported by this launcher
protected static final ParameterDefinition targetParam
protected static final ParameterDefinition logLevelParam
Constructor Detail |
---|
public AntScriptLauncher()
public AntScriptLauncher(java.lang.String scriptPath) throws InvalidParameterException
scriptPath
- the path of script to later execute
InvalidParameterException
- if path cannot be accessedMethod Detail |
---|
public java.lang.String getTarget()
public void setTarget(java.lang.String target)
target
- The target to execute in Ant scriptpublic java.lang.String getLogLevel()
public void setLogLevel(java.lang.String logLevel)
logLevel
- The level of log during executionpublic void runScript(java.util.Properties properties) throws ScriptException
scriptPath
inner
field. Properties passed as param are injected into the Ant project
as user properties. Script can directly use them using the ${property.name}
form.
runScript
in class ScriptLauncher
properties
- The runtime properties to inject into execution environment
ScriptException
- if something wrong occurs during script parsing, evaluation, ...public java.util.List getParameterDefinitionsAsList()
getParameterDefinitionsAsList
in interface Configurable
getParameterDefinitionsAsList
in class ScriptLauncher
ParameterDefinition
objectspublic void setParameter(java.lang.String parameterName, java.lang.String parameterValue) throws InvalidParameterException
setParameter
in interface Configurable
setParameter
in class ScriptLauncher
parameterName
- The name of parameter so set value forparameterValue
- The value of the paramater
InvalidParameterException
- if this parameter is not supported by this object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |