[ 
https://issues.apache.org/jira/browse/FELIX-4138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13694664#comment-13694664
 ] 

Clement Escoffier commented on FELIX-4138:
------------------------------------------

> I agree that no exceptions should be thrown at all if factory is already 
> disposed/closed.
> We can achieve this in multiple ways:
> * Check the state of the factory before calling dispose()
> * Or better Factory.dispose() check its internal state before doing anything
> * Or being notified of state changes through a listener
> 
> Anyway, I assume that the creator of the factory and the caller of dispose() 
> should be the same (I create, I dispose, not I create, you dispose).
> Seems a weird use case for me
> WDYT ?

I'm in favor of the second solution, the safer I would say. 

Even if the 'I create, I dispose' is the most comme use case, we can't be 
totally sure that 'I create, you dispose' won't happen sometimes.
                
> TypeDeclaration calls factory.dispose() even if it already has been disposed 
> (externally)
> -----------------------------------------------------------------------------------------
>
>                 Key: FELIX-4138
>                 URL: https://issues.apache.org/jira/browse/FELIX-4138
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-runtime-1.10, ipojo-manipulator-1.10.1
>            Reporter: Pierre Bourret
>            Assignee: Guillaume Sauthier
>             Fix For: ipojo-runtime-1.10.2
>
>
> In some tests, I manually destroy an iPOJO factory by calling 
> IPojoFactory.dispose()
> However, on framweork shutdown, the associated type declaration tries to call 
> the same method again, without checking the factory actual state. It may also 
> be possible that the TypeDeclaration is not unbound despite the fact the 
> factory is not active anymore.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to