Patrick Shea wrote:
I don't know for everyone but most of the time in my projects using OSGi, the
resources (bundles) are already stored on the file system so I don't see why
Felix need a second copy of those same resources.
I understand that the BundleContext is installing URL's and is not concerned
about the location but my guess is that most of the time these are local file
URL's.
It is still not clear from this which type of cache "disabling" you are
suggesting. If you simply do not want your original JAR to be copied,
then you can use a URL like "reference:file:/path/to/jar". However, this
is not a complete solution.
Ultimately, the issue comes down to two things:
1. Access to embedded resources (e.g., native libs and embedded JARs).
2. Life cycle management.
For (1) it is not possible to disable the cache completely, since
embedded resources need to be extracted and put into the file system
(especially in the case of native libs).
For (2) it is also difficult to disable the cache, since if you update
your bundle JAR file, then the framework needs to maintain the old and
the new copy. This is also complicated if you are dealing with native
libraries, which requires making copies too.
So, while it is possible to "disable" the cache in some incomplete form,
it is really difficult to completely disable the cache due to the above
issues. It is an inherent part of the framework.
If you are trying to simply eliminate duplication of your JARs, then you
are in a more difficult situation than you might think, since you will
not be getting the complete semantics of (1) and (2) above as defined by
the spec. On the other hand, if you just want the framework to forget
about its copies in between executions, then this is quite simple to
achieve without any known side effects, just delete the cache directory.
-> richard
Patrick
-----Original Message-----
From: "Richard S. Hall" <[EMAIL PROTECTED]>
Sent: Sunday, March 23, 2008 3:37pm
To: [email protected]
Subject: Re: Disable bundle cache?
Patrick Shea wrote:
This seems to be a common issue and I am also questioning the need to have a cache.
Richard can you explain the rational behind the bundle cache and why it can't
be disabled?
Well, the spec says that we have to have a cache, but that doesn't stop
us from creating some non-spec way of disabling the cache.
However, lots of people simply talk of "disabling the cache", but they
never really make it clear what the mean by this. As I mention here:
https://issues.apache.org/jira/browse/FELIX-465
There are two meanings, which do you mean?
-> richard
Thanks
Patrick
-----Original Message-----
From: "Richard S. Hall" <[EMAIL PROTECTED]>
Sent: Saturday, March 22, 2008 7:53pm
To: [email protected]
Subject: Re: Disable bundle cache?
Short answer, no. At least not in the sense of truly "disabling the
bundle cache", because the mere fact that you want Felix to remember
that there are bundles in the cache to re-get means that it must be
saving something.
However, you can install a JAR file into the cache by reference using a
URL like "reference:file:/path/to/jar", but this approach is not perfect
if you have embedded JAR files and/or native code.
-> richard
Tim Moloney wrote:
I hope this isn't a silly question but...
Is it possible to disable the bundle cache? In other words, make
Felix always get the bundle from the jar file, not from the cache?
I've found the configuration parameters that allow me to change the
profile directory, and the default profile, but nothing that would
turn off the cache.
Thanks,
Tim