On 1/24/07, Stefan Bodewig <[EMAIL PROTECTED]> wrote:
On Wed, 24 Jan 2007, Farhdine Boutzakhti
<[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]