Carsten Ziegeler  wrote
> Felix Meschberger  wrote
>> Hi,
>>
>> On 03.03.2010 20:24, Carsten Ziegeler (JIRA) wrote:
>>> Rethinking this, I think we should rather add a dispose method
>>> to the factory than a close method to the resource resolver itself.
>>> This makes the lifecycle a little bit more obvious and prevents
>>> clients from calling the close method. Only the code who created
>>> the resource resolver has the factory and can therefore dispose
>>> the resource resolver
>>
>> While you may be right from a "safety" POV, from a "custom-use" POV
>> having the close method is proably better:
>>
>>   * JCR has a Session.logout() method; where the Repository is
>>       the factory
>>   * JDBC Connections have a Connection.close() method; where the
>>       DataSource is the factory
>>   * Declarative Services ComponentInstance has a dispose() method;
>>       where the ComponentFactory is the factory
>>
>> Ok, have the dispose method on the factory is more symmetric (creation
>> and disposal in the same location); but it is probably more natural to
>> be able to just close/dispose off the ResourceResolver directly.
>>
>> Thus, I would prefer to have a close() method on the ResourceResolver
>> interface.
>>
> Yes, I think haven the dispose method in the factory has another
> advantage: we don't have to change (extend) the resource resolver interface.
> 
> I would prefer having dispose on the factory for the explained reasons,
> but we can go with a close() method on the resolver as well. It's not a
> big deal.
> 
Ok to move this forward, let's go with a close() method :)


Carsten

-- 
Carsten Ziegeler
[email protected]

Reply via email to