You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Dominik Pich <do...@pich.info> on 2008/06/02 20:00:43 UTC

new to OSGI: question about hot-swapping

Hi,
Im new to Felix and OSGI and am mainly trying to leverage OSGI's hot- 
swapping feature. I wonder about one thing in this context:

1. what happens when I hot-deploy a NEW version of my bundle WHILE the  
old one is still working? Will Felix automatically delay  deploying  
the new one?

2. or should I kinda... always use versioning and explicitly query for  
the version I want? (can I even do that?^^)

Regards,
Dominik

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


Re: new to OSGI: question about hot-swapping

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am Montag, den 02.06.2008, 20:00 +0200 schrieb Dominik Pich:
> Hi,
> Im new to Felix and OSGI and am mainly trying to leverage OSGI's hot- 
> swapping feature. I wonder about one thing in this context:
> 
> 1. what happens when I hot-deploy a NEW version of my bundle WHILE the  
> old one is still working? Will Felix automatically delay  deploying  
> the new one?
> 
> 2. or should I kinda... always use versioning and explicitly query for  
> the version I want? (can I even do that?^^)

When a bundle is updated to a new version, users of the old version do
not automatically switch to the new version. Yet the old version is
stopped, that is all services unregistered (amongst other things) and
the new version is started (all services registered amongst other
things).

To get users of the old version fully in-line with the new version of
the bundle, the framework has to rewire these users to the new bundle
version. This is not done automatically but can be triggered by calling
the PackageAdmin.refreshBundles(Bundle[]) method. This fixes the wirings
of the bundles given as arguments. If null is given all bundles are
rewired.

After rewiring the everyhting operates as if the new bundle version was
always in place the old version was never there.

Hope this helps.

Regards
Felix

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


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


Re: new to OSGI: question about hot-swapping

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Whether your new version will start working immediately depends a little 
bit on how you packaged your bundle. In some cases you may see a delay, 
in others you may not. This FAQ entry gives you some details:

    
http://cwiki.apache.org/FELIX/apache-felix-osgi-faq.html#ApacheFelixOSGiFAQ-WhenIupdatemybundle%252Cwhyaremybundle%2527soldclassesstillbeingused%253F

-> richard

Dominik Pich wrote:
> Hi,
> Im new to Felix and OSGI and am mainly trying to leverage OSGI's 
> hot-swapping feature. I wonder about one thing in this context:
>
> 1. what happens when I hot-deploy a NEW version of my bundle WHILE the 
> old one is still working? Will Felix automatically delay  deploying 
> the new one?
>
> 2. or should I kinda... always use versioning and explicitly query for 
> the version I want? (can I even do that?^^)
>
> Regards,
> Dominik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

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