OSGi framework instances should NOT share a storage directory. As far as I 
know, no framework implementation uses file locking to protect against 
concurrent modification by other processes, nor does the OSGi spec does not 
require them to do so. Also, even if the framework itself was safe, bundles 
could conflict in their own access to the storage area.

You MAY be able to do this safely using mechanisms outside of OSGi, e.g. 
running the framework once to extract all your data and them making the 
directory read-only at the Operation System level. But then there is no 
guarantee that the framework would be able to start at all without a writable 
storage area.

So I think you would be better off finding a different solution.

Regards,
Neil



> On 8 May 2015, at 12:44, Benson Margulies <[email protected]> wrote:
> 
> Let me expand on my own question.
> 
> My goal is to provision some bundles, including some fragments that unpack
> to large amounts of data in bundle storage. (Using
> BundleContext.getDataFile()). I want to then treat this as frozen -- no new
> bundles, and the data is a shared, read-only resource.  Using the
> properties below, can I do this? Or do I need to design a different
> architecture in which my shared material is not inside of the container
> after all?
> 
>   - org.osgi.framework.storage - Sets the directory to use as the bundle
>   cache; by default the bundle cache directory is felix-cache in the
>   current working directory. The value should be a valid directory name. The
>   directory name can be either absolute or relative. Relative directory names
>   are relative to the current working directory. The specified directory will
>   be created if it does not exist.
>   - felix.cache.rootdir - Sets the root directory used to calculate the
>   bundle cache directory for relative directory names. If
>   org.osgi.framework.storage is set to a relative name, by default it is
>   relative to the current working directory. If this property is set, then it
>   will be calculated as being relative to the specified root directory.
> 
> 
> On Fri, May 8, 2015 at 7:09 AM, Benson Margulies <[email protected]>
> wrote:
> 
>> Once I have provisioned some bundles into the container, can I treat it as
>> read-only and share it between processes?
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to