[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Starting bundles programatically without restarting the system

Hi Pascal,

I've debugged the Configurator class and found the following flow. The implementation class was org.eclipse.equinox.internal.simpleconfigurator.SimpleConfiguratorImpl
org.eclipse.equinox.internal.simpleconfigurator.SimpleConfiguratorImpl.applyConfiguration()
which calls applyConfiguration(configurationURL)
which calls configApplier.install(url, isExclusiveInstallation()); - (configApplier is instance of org.eclipse.equinox.internal.simpleconfigurator.ConfigApplier)
which calls refreshPackages(additionalRefresh, manipulatingContext);
which calls packageAdminService.refreshPackages(bundles); - (packageAdminService is instance of org.eclipse.osgi.framework.internal.core.PackageAdminImpl)
which calls refreshPackages(input, false);
which has a thread defined having doResolveBundles(copy, true) in the run method.
doResolveBundles(copy, true) gets called in thread
which calls processDelta(delta, refreshPackages, systemState);
by this time the refresh array contains bundles other than the newly added bundles (I think all the bundles (which some of them defines the osgi services i mentioned earlier) which has the dependant packages for the newly added bundles).
and the bundles specified in refresh array gets suspended in this function (which eventually actually puts the bundles in INSTALLED state) which effectively stops the bundle. :(

Saminda

On Sat, Aug 1, 2009 at 9:07 AM, Saminda Wijeratne <samindaw@xxxxxxxx> wrote:
Thank you Pascal, I think check what you said. We are using DS in our products.

Thank you,
Saminda


On Fri, Jul 31, 2009 at 11:14 PM, Pascal Rapicault <Pascal_Rapicault@xxxxxxxxxx> wrote:

The restart is done at the level of bundles, this is only level of restart exposed by OSGi. Therefore all the services that are registered by a given bundle will be discarded on stop and some new ones will be published on start. However this is only one side of the problem, since all the users of those services will have to release the old services and grab the new one (watching for the service lifecycles). This is the whole difficulty of such dynamic systems, but usually this is not done solely manually but you usually use ServiceTracker, DS or SpringOSGi.



>If a bundle is dependent on some osgi service does the configurator attempt to restart that service when its calling applyConfigurations()?
No.

Inactive hide details for Saminda Wijeratne ---07/31/2009 07:04:52 PM---Thank you for the explanation. Does it restart registerSaminda Wijeratne ---07/31/2009 07:04:52 PM---Thank you for the explanation. Does it restart registered osgi services? Because of my lack of investigation earlier I hadn't n


From:

Saminda Wijeratne <samindaw@xxxxxxxx>

To:

P2 developer discussions <p2-dev@xxxxxxxxxxx>

Cc:

p2-dev-bounces@xxxxxxxxxxx

Date:

07/31/2009 07:04 PM

Subject:

Re: [p2-dev] Starting bundles programatically without restarting the system




Thank you for the explanation. Does it restart registered osgi services? Because of my lack of investigation earlier I hadn't noticed that its only the services (which was registered by our product) which was restarted. And not all services restarted successfully, some failed. However the relevant bundles had remained active it seems. And the new bundles were started ok. due to failed services the system was  unusable.

the bundles newly installed do not replace any existing bundles with newer versions (or patching for that matter) but they do depend on many of the bundles that already exists in the system (alot of wiring on import packages that is). If a bundle is dependent on some osgi service does the configurator attempt to restart that service when its calling applyConfigurations()?

Thanks in advance,
Saminda

On Fri, Jul 31, 2009 at 6:55 PM, Pascal Rapicault <Pascal_Rapicault@xxxxxxxxxx> wrote:
    The code in org.eclipse.equinox.simpleconfigurator.ConfigApplier#install does not restart all the bundles. It will only uninstall, install and start the bundles that have changed. However depending on the bundles you are updating and the wiring between all the bundles of the system, more bundles will be stopped, rewired (classloading dependency) and restarted. This is how OSGi works (see the PackageAdmin#refreshPackages). For example if you were to replace the eclipse extension registry in your SDK you would take most of the system down because of its central role, however if for example you are just installing a new SCM provider you don't have to restart the system.
    HTH


    Inactive hide details for Saminda Wijeratne ---07/30/2009 06:31:43 PM---Hi,Saminda Wijeratne ---07/30/2009 06:31:43 PM---Hi,


From:

Saminda Wijeratne <samindaw@xxxxxxxx>I

To:

p2-dev@xxxxxxxxxxx

Date:

07/30/2009 06:31 PM

Subject:

[p2-dev] Starting bundles programatically without restarting the system




    Hi,

    We have successfully integrated p2 to our wso2 products. We are now trying to see whether it is possible to hot install the features. i.e. once through p2 the feature is installed without restarting the equinox framework is it possible to programatically start the new bundles. Can this be done in current implementation? a workaround perhaps?

    I've debugged through the existing ui code in Galileo and found the following code
               Configurator configurator = (Configurator) ServiceHelper.getService(Activator.getContext(), Configurator.class.getName());
               configurator.applyConfiguration();
    I've included and tried the above code but seems to stop and start all bundles in the system rather than only the new ones. Any suggestions would be helpful.

    Thanks in advance,

    Saminda_______________________________________________
    p2-dev mailing list

    p2-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/p2-dev



    _______________________________________________
    p2-dev mailing list

    p2-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/p2-dev
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev



_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev



GIF image

GIF image