org.oddjob.ant
Class AntJob
java.lang.Object
org.oddjob.framework.BaseComponent
org.oddjob.framework.BasePrimary
org.oddjob.framework.SimpleJob
org.oddjob.ant.AntJob
- All Implemented Interfaces:
- Iconic, Resetable, java.lang.Runnable, Stateful
- public class AntJob
- extends SimpleJob
- Description:
- Run a series of Ant
tasks. This job doesn't run
Ant, instead it uses the ant tasks directly. Oddjob creates
and configures the tasks and this has some side affects:
- The properties of an Ant task aren't constant. Oddjob variables
can change unlike Ant properties.
- The Ant property tag has no affect. It's Oddjob that is
setting the properties of the task, not Ant.
- Unlike Ant, the tasks are created at file parse time,
not on execution. The Ant taskdef declaration doesn't work and
some other related features.
- Types are allowed (such as pathelement) but the id
must be const. This is because the reference is set
at parse time.
Not all tasks will work and not all have been tested.
- Example:
- Please see the ant example in the provided examples.
| Methods inherited from class org.oddjob.framework.BaseComponent |
addIconListener, addJobStateListener, addPropertyChangeListener, arooaRuntime, arooaRuntime, canHardReset, canSoftReset, configure, destroy, getLocation, iconForId, lastJobStateEvent, removeIconListener, removeJobStateListener, removePropertyChangeListener, setJobStateComplete, setJobStateException, setJobStateNotComplete |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AntJob
public AntJob()
handlerFor
public ArooaHandler handlerFor(ArooaContext context)
- Provide a handler to parse children.
addComponent
public void addComponent(org.apache.tools.ant.ProjectComponent component)
- Add an Ant ProjectComponent to this job.
- Parameters:
component - The project component.
setOutput
public void setOutput(java.io.OutputStream out)
getOutput
public java.io.OutputStream getOutput()
- Return the ant tasks output.
- Returns:
- The output as a string.
getProject
public org.apache.tools.ant.Project getProject()
- Get the project used for the tasks.
- Returns:
- The project.
setProject
public void setProject(org.apache.tools.ant.Project project)
throws OddjobException
- Set the project to use for the tasks. Can only be set once.
It is assumed the project is already initialised.
- Parameters:
project - The project.
- Throws:
OddjobException - if the project is already set.
setMessageLevel
public void setMessageLevel(java.lang.String messageLevel)
getMessageLevel
public java.lang.String getMessageLevel()
execute
protected int execute()
throws java.lang.Exception
- Execute the tasks.
- Specified by:
execute in class SimpleJob
- Returns:
- 0 if the job is complete, anything else otherwise.
- Throws:
java.lang.Exception - If the unexpected occurs.
onDestroy
public void onDestroy()
- Destroy.
- Overrides:
onDestroy in class BaseComponent