On Tuesday 25 June 2002 3:45 pm, Conor MacNeill wrote: > 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
Thank you for your answer. I have seen the life-cycle, but I wasn't sure what does the "parser-time" mean exactly and how many instances get created. Cheers Matt -- Matt Koss Knowledge Media Institute Open University e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
