cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Molenkamp" <b.molenk...@bizzdesign.nl>
Subject RE: Calling SitemapSource.getInputStream() more than once throws SourceException
Date Thu, 14 Oct 2004 14:33:53 GMT
Well, is the refresh() working correctly for SitemapSource? I've
extended the SourceDataSource, and overriden the getInputStream():

if (needsRefresh) {
	source.refresh();
}
			
needsRefresh = true;
return super.getInputStream(); // returns inputstream from source.


Again, an exception is thrown by getInputStream() when it's called for
the second time.

Bart.

> 
> Bart Molenkamp wrote:
> > Hi all,
> >
> > I've noticed that it's not possible to call the getInputStream() on
> > instances of SitemapSource classes can only be called once. Calling
it a
> > second time throws an exception.
> >
> > Is that correct behaviour, or is that a bug?
> 
> No. See org.apache.excalibur.source.Source.refresh().
> 
> 
> > In my use-case, I use pipelines to generate the body for email
messages.
> > I resolve the source, and create a new
> > org.apache.cocoon.mail.datasource.SourceDataSource instance and pass
the
> > source to it. When sending, it looks like the JavaMail api calls the
> > getInputStream() more than once.
> 
> It's bug in SourceDataSource then. It should make sure refresh() is
called
> as
> needed.
> 
> Vadim

Mime
View raw message