[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] same bundle in multiple regions

BJ is correct. Just to elaborate. The framework enforces an invariant that ensures all bundles installed in the Framework have a unique bundle location string. Regions, hooks, etc. cannot do anything to break this enforced invariant.

If you use the Region.installBundle method it will modify the location string to ensure it is unique on installation. It does this by appending a URI fragment to the input location which includes the region name. For example, the location string file://bundles/mybundle.jar becomes file://bundles/mybundle.jar#region1 if the region name is region1. You should do the something similar if you are not going through the Region API to install the bundles.

Tom



Inactive hide details for BJ Hargrave---09/23/2011 06:18:40 AM---You can install the same bundle (same bits) using different loBJ Hargrave---09/23/2011 06:18:40 AM---You can install the same bundle (same bits) using different locations strings. But a location string is a unique identifier for


From:

BJ Hargrave/Austin/IBM@IBMUS

To:

Equinox development mailing list <equinox-dev@xxxxxxxxxxx>,

Date:

09/23/2011 06:18 AM

Subject:

Re: [equinox-dev] same bundle in multiple regions




You can install the same bundle (same bits) using different locations strings. But a location string is a unique identifier for an installed bundle. Use the 2 argument version of BundleContext.installBundle using unique location strings to install a bundle from the same URL multiple times.
--

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the
OSGi Alliance
hargrave@xxxxxxxxxx

office: +1 386 848 1781
mobile: +1 386 848 3788






From:
Borislav Kapukaranov <b.kapukaranov@xxxxxxxxx>
To:
equinox-dev@xxxxxxxxxxx,
Date:
2011/09/23 06:58
Subject:
[equinox-dev] same bundle in multiple regions
Sent by:
equinox-dev-bounces@xxxxxxxxxxx




Hey folks,


I have a question on installing a bundle from the same location.

Take the latest Virgo 3.0.x as a good example of more than one region and connect with telnet to each console.

If you try to install a bundle from the same location in both regions via each region's console this will fail with something like "Bundle already installed...".


Is this working as designed? Shouldn't it be possible to install a bundle from the same location(same string) if it's in different regions - Equinox may treat it as a different bundle and create it its own data folder, id, etc?

http://dev.eclipse.org/mhonarc/lists/equinox-dev/msg06875.html suggest that should be possible, as the first installation won't be visible to the context of the other region.

Thanks,

Bobby
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


GIF image

GIF image