excalibur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: Optimizing SourceResolver.release()
Date Fri, 29 Jul 2005 06:36:10 GMT
Sylvain Wallez schrieb:
> Carsten Ziegeler wrote:
> 
> 
>>Sylvain Wallez schrieb:
>> 
>>
>>
>>>Hi all,
>>>
>>>I'd like to propose a small change to the Source contract so that 
>>>SourceResolver.release() is far more efficient.
>>>
>>>Currently, releasing a Source requires to lookup the SourceFactory in 
>>>the selector and calling release(Source) on that class. Now looking 
>>>around, I found only _one_ implementation of SourceFactory that 
>>>effectively does something useful in it's release() method, which is 
>>>Cocoon's SitemapSourceFactory.
>>>
>>>All other implementations do _nothing_, leading to a lot of useless 
>>>lookups. Considering how much source-intensive Cocoon is, this may be 
>>>significant.
>>>
>>>To avoid this, I'd like to propose a small change to the 
>>>SourceResolver.release() contract: if the Source implements Disposable, 
>>>then it's dispose() method is called, and otherwise the factory is 
>>>looked up as of today.
>>>
>>>We then have to add empty dispose() methods to all source 
>>>implementations to benefit from the performance improvement.
>>>
>>>How does that sound?
>>>
>>>   
>>>
>>
>>Don't know, but I don't like the dependency to Disposable.
>>It would be better if we could keep the interfaces clean from
>>Avalon core interfaces.
>>
>>The early versions of the Source interface had a "release()" method
>>which did exactly what you propose. So perhaps we can add an own
>>interface for this in the o.a.e.source package instead?
>> 
>>
> 
> 
> If we do this, this changes the Source interface, and may lead to more 
> compatibility problems with implementations out there.
> 
> A solution would be to add a "ReleasableSource" interface that extends 
> Source and provides the release() method. That way, we don't add 
> dependencies on the framework.
> 
That is what I meant :)

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

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


Mime
View raw message