felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <ben...@basistech.com>
Subject Re: Read-only cache
Date Fri, 08 May 2015 19:59:20 GMT
On Fri, May 8, 2015 at 8:17 AM, Neil Bartlett <njbartlett@gmail.com> wrote:

> 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.
>

As it happens, Knopflerfish has a readonly mode which permits sharing a
provisioned storage directory. Unfortunately, it does not do what I need
for data associated with bundles -- it just disables all access to storage
instead of treating it as read-only.

I suppose i could try to sell a patch for this purpose to the dev list, I'm
not sure I'm prepared to climb that hill.



>
> 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 <benson@basistech.com> 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 <benson@basistech.com>
> > 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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message