cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject [C2]: Possible Problems with the new Source interface
Date Thu, 06 Sep 2001 09:16:12 GMT
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)?


Open Source Group                        sunShine - b:Integrated
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn                          mailto: 

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

View raw message