See bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=298416 for details.

In the recent Equinox 3.6 builds you can specify the configuration property
eclipse.stateSaveDelayInterval=0 to get immediate persistence of the
framework cache.  Although I still caution against using System.exit
instead of cleanly shutting down the framework.  There is no telling what
the other bundles may be doing at the time you call System.exit.  It would
be much better to shutdown the framework cleanly so that all bundles in the
framework are stopped and able to persist their information as well.

Tom




|------------>
| From:      |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |"Alan D. Cabrera" <[email protected]>                                     
                                                                      |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |OSGi Developer Mail List <[email protected]>                            
                                                                     |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |03/05/2010 08:22 AM                                                          
                                                                     |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: OSGi Framework persistence underspecified ? (was: Re: [osgi-dev] Osgi 
Launchers Question)                                                  |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|






On Mar 5, 2010, at 1:53 AM, Guillaume Nodet wrote:

      I've had the problem because equinox actually persists the system
      changes asynchronously.  Unfortunately if another bundle persists
      some
      information using
        BundleContext#getDataFile()
      things can become out of sync.

      For example, consider the following bundle activator:

      public void start(BundleContext context) throws Exception
      {
        String location = "http://host/bundle.jar";;
        File persist = bundleContext.getDataFile("installed");
        if (!persist.exists()) {
            bundleContext.installBundle(location);
            OutputStream os = new FileOutputStream(persist);
            os.write(location.getBytes());
            os.close();
        }
      }

      Consider that as a dummy initial provisioning system.

      Now, your hope would be that if the installed file exists, the bundle
      is installed, right ?  Unfortunately, there's no guarantee around
      that.
      Actually, I think Felix guarantee that, but Equinox does not, and if
      you kill the process right after the activator has been called, upon
      restart, the bundle will not be installed anymore.

      Is that an expected behavior ?  Thoughts ?


This strikes me as a bug.  After BundleContext.installBundle() returns the
framework must have persistently recorded the installation for later
restarts.


Regards,
Alan
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to