ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "didge" <di...@foundrylogic.com>
Subject RE: ChainableReader behavior
Date Fri, 31 Jan 2003 23:17:54 GMT
My guess is that the filterchain implementation was meant to be faithful to
how unix pipes work.  The bottom line is that the current implementation
makes it difficult to pass state between filterchains.

In the interim, I can more quickly support this very desirable behavior in
vpp by allowing the user to specify a unique id parameter for the filter.
This will allow filters sharing the same id to share a common cache,
including the context and the engine.  It would look something like this:

        <vpp todir="${build_dir_http}"
               overwrite="true">
            <fileset dir="${http_templates_dir}" includes="**/*"/>

---->       <velocityProperty type="vpp" key="id" value="someUniqueId"/>

            <velocityProperty type="engine" key="runtime.log"
value="${runtime.log}"/>
        </vpp>

I'll probably have a new release of VPP with this capability by Monday.

But, the ideal solution would be to have Ant solve this generally, but only
if this is kind of behavior is generally desirable, of course.  One of these
two methods might work:

(1) Have Ant use the chain() method at the filter level, rather than at the
global level, i.e. for each filter in the chain, an instance of the filter
would be created to chain the working instances via the chain() method.  It
is not enough to do this at the task level since the same type of filter
could be used multiple times in a chain.

(2) Have Ant assign a unique id to each filter position in the chain and
pass that id to the instance so it could use it for its own caching
purposes.  This would be analogous to what I suggested above.

Personally, I like (1), the chaining option, better.

Magesh, do you have any opinion on this (given your name is all over the
filterchain code :).


didge


> -----Original Message-----
> From: Magesh Umasankar [mailto:umagesh@apache.org]
> Sent: Friday, January 31, 2003 11:51 AM
> To: Ant Users List
> Subject: Re: ChainableReader behavior
>
>
> ----- Original Message -----
> From: "didge" <didge@foundrylogic.com>
>
>
> > > From: Kief Morris [mailto:kief@kief.com]
> > > I'm trying to figure out the behavior of ChainableReader
> implementations
> > > under copy type tasks. In particular, it seems that the Reader has its
> > > initialize() method called for each file being copied, which
> is leading
> > > to some deeper problems. Is this the correct behavior?Kief,
> >
> > Kief,
> >
> > Ouch, this is not the way that I thought filterchains were
> created, but it
> > appears that so.  I thought that each filter in a chain was
> first created,
> > then initialized, just once for a given task.  But in fact, it
> looks like
> > the entire chain is created, initialized and then discarded for
> each file
> > processed, which for VPP, incurs a lot of overhead.
> >
> > Anyone,
> >
> > Is there anyway that the filterchain can be reused within a task?
>
> If patched, yes ;-)
>
> Please send in a patch that would retain current behavior as well
> as add the enhancement you are seeking - that of being able to
> reuse a filterchain within a task.
>
> > didge
>
> Cheers,
> Magesh
>
> ************************************************
> *  Office: A place where you can relax after   *
> *  your strenuous home life.                   *
> ************************************************
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-user-help@jakarta.apache.org
>
>


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


Mime
View raw message