cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject Re: AW: [c2] timeout parameter to FileGenerator
Date Wed, 16 May 2001 17:58:06 GMT
On Wed, 16 May 2001, Carsten Ziegeler wrote:

> > generate method, the parser will fire off another connection:
> >
> >             parser.parse(this.inputSource);
> >
> > hmm. that's not so good. is this an accurate assessment?
> >
> Yes, absolutely, it's totally bad. It was a first quick shot at
> implementing caching for the file generator. This really should
> be changed.
> As far as I know this code is used in several components.

hee. hmm. well i took a first pass at adding support for a timeout
parameter to c2, but i don't think my approach was good. i added a
WorkerThread inner class to the FileGenerator and put the parsing stuff in
it. the main thread waits on a shared lock object until notified or until
the timeout has expired. it works okay, but there are two problems:

1. you can't stop java threads any longer (!) and the interrupt signal is
only recognized if the receiving thread is sleeping or waiting.

2. there is no guarantee that the parser doesn't fire off subthreads of
its own to do its work. just because parser.parse() returns doesn't mean
that parsing is complete.

my next thought is to create a TimeoutContentHandler inner class that
wraps the normal ContentHandler and reports a timeout error to its parent
if the endDocument() method hasn't been called by the timeout. any

- donald

To unsubscribe, e-mail:
For additional commands, email:

View raw message