views:

281

answers:

2

Relating to a previous question, how let OSGi to reuse your configuration via Config Admin, I am still trying to solve this problem in the Equinox Framework.

Pavol Juhos wrote:

Equinox Config Admin (org.eclipse.equinox.cm) stores the configuration data in the persistent storage area provided by the Framework. And that happens to be the "local bundle cache" directory by default for Equinox.

So i read up on this topic and found that there are several runtime options for Equinox (among other things osgi.configuration.area).

What I want is to change the configuration, in order that the local bundle cache won't be droped or cleaned, so the next time I'll run the Framework, the last entered configuration (for any bundle) will be used.

A: 

The OSGi standard property for specifying whether the bundle cache should be purged on framework startup is org.osgi.framework.storage.clean

org.osgi.framework.storage.clean - Determines whether the bundle cache is flushed. The value can either be "none" or "onFirstInit", where "none" does not flush the bundle cache and "onFirstInit" flushes the bundle cache when the framework instance is first initialized. The default value is "none".

This is a relatively new one (in fact, it is still a draft, find it in the R4.2 Draft under section 4.2.2), but it should work in recent Equinox versions, I guess.

Thilo
Could you please post the link to the specification? I don't find that property in association with Equinox.
ChrisBenyamin
+1  A: 

There is also the osgi.clean property. If you set this to true, the OSGi container must delete the existing bundle cache (and all related data) on startup and reload the bundles into the runtime cache. If you set this to false then your bundle cache should survive a restart.

This is documented in the Eclipse SDK Equinox Runtime Options.

omerkudat
This works for me. Simply starting the Run Config with the parameter "-osgi.clean=false" - Thanks
ChrisBenyamin
+1 an accepted answer deserves an upvote
stacker