You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by ya...@bull.net on 2011/07/06 10:46:57 UTC

iPojo lifecycle and dependencies

Hi,
I'am facing a problem with iPOJO about the dependencies and the lifecycle.
One of my components creates a configuration for config admin for each 
services of a specific type (bind / unbind optionnal & aggregate).
During my test, i try to stop and restart my bunble in order to test if 
all my system works again, and here is the problem.

When my bundle stops i have to remove all the configurations. But if the 
bundle stops the unbind function is not called, so the configurations are 
not deleted. So i can remove them in the invalidate handler?! But i can't. 
Indeed if the invalidation is not due to a stop event but due to 
dependency insatisfaction, i had removed all the configurations and when 
my component will be valid again, the bind function will not be called.

Why this "inconsistency"?

When the dependency handler of a component is created, all the current 
available services are bound (l 274 Depenency.java)
Why not called unbind when the component is "destroyed" or why not provide 
a option to specify an start/stop service tracker when the component 
starts/stops?

Thanks

Re: iPojo lifecycle and dependencies

Posted by ya...@bull.net.
I have tried your solution. But i have the same issue. Unbinds are not 
called.

Yann



De :    Carlos Quiroz <cq...@gemini.edu>
A :     "<us...@felix.apache.org>" <us...@felix.apache.org>
Date :  06/07/2011 14:43
Objet : Re: iPojo lifecycle and dependencies



Hi

I have had a similar problem with unbind not being called if optional and 
agreggate

As a workaround I added the same id to the @Bind/@Unbind and now it is 
working fine

Carlos

On Jul 6, 2011, at 4:46 AM, <ya...@bull.net>
 <ya...@bull.net> wrote:

> Hi,
> I'am facing a problem with iPOJO about the dependencies and the 
lifecycle.
> One of my components creates a configuration for config admin for each 
> services of a specific type (bind / unbind optionnal & aggregate).
> During my test, i try to stop and restart my bunble in order to test if 
> all my system works again, and here is the problem.
> 
> When my bundle stops i have to remove all the configurations. But if the 

> bundle stops the unbind function is not called, so the configurations 
are 
> not deleted. So i can remove them in the invalidate handler?! But i 
can't. 
> Indeed if the invalidation is not due to a stop event but due to 
> dependency insatisfaction, i had removed all the configurations and when 

> my component will be valid again, the bind function will not be called.
> 
> Why this "inconsistency"?
> 
> When the dependency handler of a component is created, all the current 
> available services are bound (l 274 Depenency.java)
> Why not called unbind when the component is "destroyed" or why not 
provide 
> a option to specify an start/stop service tracker when the component 
> starts/stops?
> 
> Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



Re: iPojo lifecycle and dependencies

Posted by Carlos Quiroz <cq...@gemini.edu>.
Hi

I have had a similar problem with unbind not being called if optional and agreggate

As a workaround I added the same id to the @Bind/@Unbind and now it is working fine

Carlos

On Jul 6, 2011, at 4:46 AM, <ya...@bull.net>
 <ya...@bull.net> wrote:

> Hi,
> I'am facing a problem with iPOJO about the dependencies and the lifecycle.
> One of my components creates a configuration for config admin for each 
> services of a specific type (bind / unbind optionnal & aggregate).
> During my test, i try to stop and restart my bunble in order to test if 
> all my system works again, and here is the problem.
> 
> When my bundle stops i have to remove all the configurations. But if the 
> bundle stops the unbind function is not called, so the configurations are 
> not deleted. So i can remove them in the invalidate handler?! But i can't. 
> Indeed if the invalidation is not due to a stop event but due to 
> dependency insatisfaction, i had removed all the configurations and when 
> my component will be valid again, the bind function will not be called.
> 
> Why this "inconsistency"?
> 
> When the dependency handler of a component is created, all the current 
> available services are bound (l 274 Depenency.java)
> Why not called unbind when the component is "destroyed" or why not provide 
> a option to specify an start/stop service tracker when the component 
> starts/stops?
> 
> Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org