Matt Koss wrote:
> I am trying to understand the execution loop of the task.
> 
> I have written a custom task and I have put the initialisation code inside of 
> the init() method.
> I thought that init() method is called only once ( for taskdef ) and that 
> execute() method is then called for each occurence of the custom task.
> 
> However, init() method is called for each occurence of my task.
> Is this the correct behaviour ?
> 

This is correct. Taskdef does not create an instance of your task. It 
creates a mapping from a taskname to a Java class. There will be a new 
instance of your custom task for each instance in the XML.

Check out the following link for the lifecyle of a task and when init() is 
called relative to execute().

http://jakarta.apache.org/ant/manual/develop.html#writingowntask

Conor



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to