ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: Passing data between 2 created tasks
Date Thu, 25 Jan 2007 09:28:19 GMT
On 1/24/07, Stefan Bodewig <bodewig@apache.org> wrote:
> On Wed, 24 Jan 2007, Farhdine Boutzakhti
> <farhdine.boutzakhti@calyon.com> wrote:
>
> > I am creating 2 different tasks with ANT:
> >
> > A - One extracting some data in a stack from a cache,
> >
> > B - One inserting these data in a database.
> >
> > I want to know if there is a way to pass an object (i.e. a stack)
> > from A to B?
>
> The easiest way probably uses references.  Add your stack as a named
> reference to the project instance of task A and retrieve it in B.
>
Just be careful with classloaders.
i.e. make sure that task A and task B are created with the
same classloader - either by using a propertys/antlib and a
single <taskdef> or by using multiple <taskdef>'s with
the help of loaderref:
i.e:
<path id="lib.path">
   <fileset dir="lib" includes="*.jar"/>
</path>
<taskdef name="A" classname="org.acme.taskdefs.A"
             classpathref="lib.path"
             loaderref="my.loader.ref"/>
<taskdef name="B" classname="org.acme.taskdefs.B"
             classpathref="lib.path"
             loaderref="my.loader.ref"/>

Peter
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message