Skip to main content



      Home
Home » Eclipse Projects » Equinox » How to disable Equinox from caching my bundle?
How to disable Equinox from caching my bundle? [message #75360] Tue, 24 October 2006 14:22 Go to next message
Eclipse UserFriend
I noticed every bundle I installed a bundle Equinox will cache it in its
configuration directory. Is there a way to prevent Equinox from doing that?
Thanks!
Re: How to disable Equinox from caching my bundle? [message #75426 is a reply to message #75360] Tue, 24 October 2006 15:46 Go to previous messageGo to next message
Eclipse UserFriend
Hi Shean,

You can install by "reference" if you do not want Equinox to copy the
content of the bundle into is local cache.

You can do this by using a "reference" URL stream. For example

BundleContext context = getBundleContext();
URL reference = new URL("reference:file:/mybundles/bundleA.jar");
Bundle bundleA =
context.installBundle("bundleA", reference.openStream());
// or you can just pass the URL string as the location
Bundle bundleB =
context.installBundle("reference:file:/mybundles/bundleB.jar ");

The framework will just use the content from the file you indicated in
the reference URL. Note that the framework still keeps track that the
bundle is installed. On a restart the bundle will still be installed
and will use the content from the reference location again.

HTH

Tom


Shean-Guang Chang wrote:
> I noticed every bundle I installed a bundle Equinox will cache it in its
> configuration directory. Is there a way to prevent Equinox from doing that?
> Thanks!
>
>
Re: How to disable Equinox from caching my bundle? [message #75763 is a reply to message #75426] Fri, 27 October 2006 10:04 Go to previous messageGo to next message
Eclipse UserFriend
If I am using the input stream API but with special location (e.g.
"reference:XXXX") will that work?
"Tom Watson" <tjwatson@us.ibm.com> wrote in message
news:ehlqjh$1v1$1@utils.eclipse.org...
> Hi Shean,
>
> You can install by "reference" if you do not want Equinox to copy the
> content of the bundle into is local cache.
>
> You can do this by using a "reference" URL stream. For example
>
> BundleContext context = getBundleContext();
> URL reference = new URL("reference:file:/mybundles/bundleA.jar");
> Bundle bundleA =
> context.installBundle("bundleA", reference.openStream());
> // or you can just pass the URL string as the location
> Bundle bundleB =
> context.installBundle("reference:file:/mybundles/bundleB.jar ");
>
> The framework will just use the content from the file you indicated in
> the reference URL. Note that the framework still keeps track that the
> bundle is installed. On a restart the bundle will still be installed
> and will use the content from the reference location again.
>
> HTH
>
> Tom
>
>
> Shean-Guang Chang wrote:
> > I noticed every bundle I installed a bundle Equinox will cache it in its
> > configuration directory. Is there a way to prevent Equinox from doing
that?
> > Thanks!
> >
> >
Re: How to disable Equinox from caching my bundle? [message #76155 is a reply to message #75763] Wed, 01 November 2006 14:49 Go to previous message
Eclipse UserFriend
Shean-Guang Chang wrote:
> If I am using the input stream API but with special location (e.g.
> "reference:XXXX") will that work?
>

To use the InputStream API
BundleContext.installBundle(String, InputStream)

You must use the InputStream from a reference URL. From my previous
example ...

BundleContext context = getBundleContext();
URL reference = new URL("reference:file:/mybundles/bundleA.jar");
Bundle bundleA =
context.installBundle("bundleA", reference.openStream());

Notice the reference.openStream() call. This opens a special
inputstream from the reference ULR that the framework understands as a
reference location. There is no other way to do this. Any other type
of InputSteam the Framework will use the read bundle content from and
cache into its own local cache. There is no way for the Framework to
understand that the InputStream can be referenced.

Tom
Previous Topic:develoment and debugging on tomcat?
Next Topic:synchronous bundle listener question to deny bundle to be installed?
Goto Forum:
  


Current Time: Wed Jul 23 15:30:20 EDT 2025

Powered by FUDForum. Page generated in 0.03715 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top