FrameworkProperties.setProperty("osgi.forcedRestart",
Boolean.toString(true));
bContext.getBundle(0).stop(org.osgi.framework.Bundle.STOP_TRANSIENT);Shutting down bundle zero will gracefully shutdown the OSGi framework. Setting the osgi.forcedRestart property will force an exit code that signals the launcher to restart the OSGi framework ... however I'm not sure what the standard eclipse launcher does when it sees this exit code: our customized launcher restarts it. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Brian de Alwis Sent: Friday, October 15, 2010 10:00 PM To: P2 developer discussions Subject: Re: [p2-dev] How to build an update site for a product? I hoped some p2 experts might be able to answer this still-unanswered part of Samuel's question: On Thu, Sep 9, 2010 at 8:39 AM, Samuel Wu <[email protected]> wrote: > [...] what are you going to do if you find you need to ship a > new osgi runtime or webserver? Although the product package works as a stub > and its size is small, it still has the chance to be updated. My question > is how you are going to ship that update to the product. It's more > important in your case because your customer has to pick up the product as > a stub and reinstall the real features after the product update. I've been playing around with shipping a small headless product that does nothing but replaces itself with a different product. I have a similar concern as I too would like to ship Equinox updates along with my app. In my case, I'm using the lower-level org.eclipse.equinox.p2.planner.IProfileChangeRequest-based operations rather than the org.eclipse.equinox.p2.operations.ProfileChangeOperation-based operations so that I can perform IU removals with IU additions/updates in one fell swoop. I've got this working well now. But during my testing I made a mistake in having the replacement product specify a different version of the system bundle (org.eclipse.osgi). Installing this product and thenapplying the change with org.eclipse.equinox.internal.provisional.configurator.Configurator#apply Configuration() led to an IllegalStateException: java.lang.IllegalStateException: The System Bundle was updated. The framework must be restarted to finalize the configuration change How do I cause a restart? Is there a generally accepted mechanism in OSGi, or is calling org.osgi.service.packageadmin.PackageAdmin#refreshPackages(null) sufficient? Brian. _______________________________________________ p2-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/p2-dev _______________________________________________ p2-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/p2-dev
