Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-01-28 11:21:23 -0500
committerGlyn Normington2011-01-28 11:21:23 -0500
commitca911ddd68ffeac684a689a9d4cf34f837d42c22 (patch)
treec882a084062323f8216fe51ea52d24fb41e31c90 /org.eclipse.virgo.kernel.userregionfactory
parent730f6d095f4d33e7155f691cd195e86b44815735 (diff)
downloadorg.eclipse.virgo.kernel-ca911ddd68ffeac684a689a9d4cf34f837d42c22.tar.gz
org.eclipse.virgo.kernel-ca911ddd68ffeac684a689a9d4cf34f837d42c22.tar.xz
org.eclipse.virgo.kernel-ca911ddd68ffeac684a689a9d4cf34f837d42c22.zip
bug 330776: relax restriction that a region and its inbound filters may not both contain a given bundle symbolic name and bundle version
Diffstat (limited to 'org.eclipse.virgo.kernel.userregionfactory')
-rw-r--r--org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java18
-rw-r--r--org.eclipse.virgo.kernel.userregionfactory/template.mf2
2 files changed, 8 insertions, 12 deletions
diff --git a/org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java b/org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java
index 50c04f73..d3b35fad 100644
--- a/org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java
+++ b/org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java
@@ -139,10 +139,14 @@ public final class Activator implements BundleActivator {
private void createUserRegion(BundleContext userRegionBundleContext, RegionDigraph regionDigraph) throws BundleException {
BundleContext systemBundleContext = getSystemBundleContext();
+ Bundle userRegionFactoryBundle = userRegionBundleContext.getBundle();
+
+ Region kernelRegion = getKernelRegion(regionDigraph);
+ kernelRegion.removeBundle(userRegionFactoryBundle);
Region userRegion = new BundleIdBasedRegion(REGION_USER, regionDigraph, systemBundleContext);
-
- Region kernelRegion = getKernelRegion(regionDigraph);
+ regionDigraph.addRegion(userRegion);
+ userRegion.addBundle(userRegionFactoryBundle);
RegionFilter kernelFilter = createKernelFilter(systemBundleContext);
userRegion.connectRegion(kernelRegion, kernelFilter);
@@ -215,21 +219,13 @@ public final class Activator implements BundleActivator {
String expandedUserRegionImportsProperty = null;
if (userRegionImportsProperty != null) {
expandedUserRegionImportsProperty = PackageImportWildcardExpander.expandPackageImportsWildcards(userRegionImportsProperty,
- this.bundleContext);
+ systemBundleContext);
}
- //expandedUserRegionImportsProperty += getSystemBundleExports(systemBundleContext);
-
UserRegionPackageImportPolicy userRegionPackageImportPolicy = new UserRegionPackageImportPolicy(expandedUserRegionImportsProperty);
return userRegionPackageImportPolicy;
}
- private String getSystemBundleExports(BundleContext systemBundleContext) {
- //systemBundleContext.getBundle().get
- // TODO Auto-generated method stub
- return ",org.osgi.framework,org.osgi.service.packageadmin,org.eclipse.osgi.baseadaptor,org.eclipse.osgi.baseadaptor.bundlefile";
- }
-
private BundleContext getSystemBundleContext() {
return this.bundleContext.getBundle(0L).getBundleContext();
}
diff --git a/org.eclipse.virgo.kernel.userregionfactory/template.mf b/org.eclipse.virgo.kernel.userregionfactory/template.mf
index 95c321b5..228ea8cd 100644
--- a/org.eclipse.virgo.kernel.userregionfactory/template.mf
+++ b/org.eclipse.virgo.kernel.userregionfactory/template.mf
@@ -11,7 +11,7 @@ Import-Template:
org.osgi.framework.*;version="0",
org.osgi.service.*;version="0",
org.eclipse.virgo.medic.*;version="${org.eclipse.virgo.medic:[=.=.=, =.+1)}"
-Import-Package: org.aspectj.lang
+Import-Package: org.aspectj.lang;version="0"
Bundle-Activator: org.eclipse.virgo.kernel.userregionfactory.Activator
Excluded-Imports: org.easymock,
org.eclipse.virgo.osgi.launcher.*,

Back to the top