cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@sundn.de>
Subject AW: [C2]: Possible Problems with the new Source interface
Date Thu, 06 Sep 2001 12:44:31 GMT
> Berin Loritsch wrote:
> 
> Carsten Ziegeler wrote:
> > 
> > Hi Team,
> > 
> > I am not quiet sure, put I have some strange feelings with the
> > changes to the Source interface.
> > 
> > The source interface is now split into Source and ModifiableSource.
> > This is a good idea, but I am not sure if it is practicable.
> > The original idea behind the refresh() method which builds now the
> > ModifiableSource interface, was to refresh and reset the Source object.
> > The reason for this is, that there might be Source objects were you
> > can only get an InputStream once. So if you want to read more
> > than once from a Source object you should call getInputStream(),
> > refresh() and then again getInputStream().
> > For example, the URLSource (http connection) needs this, as you
> > can get only once an inputstream from a connection and calling
> > refresh() creates a new connection object.
> > 
> > Now splitting this functionality into a subinterface makes the
> > handling of Source objects very difficult: you have first
> > to call getInputStream(), test if it is a ModifiableSource, if
> > so call refresh() and can then call getInputStream() again.
> > 
> > The SitemapSource (describing a cocoon: url) needs this refresh()
> > call, too.
> > 
> > So I would propose to add a new method to the Source interface
> > which will make several calls to getInputStream possible.
> > Any idea for a name (refresh and recycle are already used)?
> 
> What about the getInputStream() method checking to see if it needs
> to be refreshed, and handle that automatically.  I don't think
> altering the interface should be done.  I think the implementation
> needs to enforce the contract that getInputStream() always returns
> a working InputStream().
> 
Yes, good idea. Sometimes one is thinking too technical. Will do that!

Carsten

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

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


Mime
View raw message