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.
Regards
Felix
>
>> Implement ResourceResolverFactory concept
>> -----------------------------------------
>>
>> Key: SLING-1262
>> URL: https://issues.apache.org/jira/browse/SLING-1262
>> Project: Sling
>> Issue Type: New Feature
>> Components: API, JCR
>> Reporter: Felix Meschberger
>> Assignee: Felix Meschberger
>>
>> See
>> http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html
>