Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-03-30 05:40:52 -0400
committerGlyn Normington2011-03-30 05:40:52 -0400
commite76d7b56f718836fdffba4fc1f1ac95fd659f080 (patch)
tree10672f04216d8ca7a70353b39f16d05758b1c9f0
parentd393111111590040791eac9a26f0f98cdb799595 (diff)
downloadorg.eclipse.virgo.kernel-e76d7b56f718836fdffba4fc1f1ac95fd659f080.tar.gz
org.eclipse.virgo.kernel-e76d7b56f718836fdffba4fc1f1ac95fd659f080.tar.xz
org.eclipse.virgo.kernel-e76d7b56f718836fdffba4fc1f1ac95fd659f080.zip
bug 336941: create resolver hook factory for a possibly disconnected region digraph
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java25
1 files changed, 8 insertions, 17 deletions
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java
index 64965ea1..b6606aee 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/StandardQuasiFramework.java
@@ -24,7 +24,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.eclipse.osgi.internal.resolver.StateImpl;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
@@ -42,6 +41,7 @@ import org.eclipse.virgo.kernel.osgi.quasi.QuasiResolutionFailure;
import org.eclipse.virgo.kernel.osgi.region.Region;
import org.eclipse.virgo.kernel.osgi.region.RegionDigraph;
import org.eclipse.virgo.kernel.osgi.region.RegionFilter;
+import org.eclipse.virgo.kernel.osgi.region.hook.RegionResolverHookFactory;
import org.eclipse.virgo.kernel.userregion.internal.equinox.TransformedManifestProvidingBundleFileWrapper;
import org.eclipse.virgo.kernel.userregion.internal.quasi.ResolutionFailureDetective.ResolverErrorsHolder;
import org.eclipse.virgo.repository.Repository;
@@ -52,7 +52,6 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
import org.osgi.framework.Version;
import org.osgi.framework.hooks.resolver.ResolverHookFactory;
import org.slf4j.Logger;
@@ -71,8 +70,6 @@ final class StandardQuasiFramework implements QuasiFramework {
private final RegionFilter TOP;
- private final String TOP_FILTER = "(|(!(x=*))(x=*))";
-
private static final String REGION_LOCATION_DELIMITER = "@";
private static final String COREGION_SUFFIX = ".coregion";
@@ -129,19 +126,13 @@ final class StandardQuasiFramework implements QuasiFramework {
}
private void setResolverHookFactory() {
- // XXX Bug 332771: Temporary workaround since the resolver hook is not driven by default for State resolutions
- if (this.state instanceof StateImpl) {
- // Following not used as ServiceRegistry is a bit fiddly to get
- // ResolverHookFactory resolverHookFactory = new CoreResolverHookFactory(xx,yy);
- // ((StateImpl) this.state).setResolverHookFactory(resolverHookFactory);
-
- ServiceReference<ResolverHookFactory> ref = this.bundleContext.getServiceReference(ResolverHookFactory.class);
- if (ref != null) {
- ResolverHookFactory resolverHookFactory = this.bundleContext.getService(ref);
- ((StateImpl) this.state).setResolverHookFactory(resolverHookFactory);
- this.bundleContext.ungetService(ref);
- }
- }
+ /*
+ * Create a resolver hook factory for the region digraph. If the region digraph is live, this will create a hook
+ * factory equivalent to the live hook factory. If the region digraph is disconnected (a reconstituted copy of a
+ * live region digraph), this will produce a hook factory independent of the live hook factory.
+ */
+ ResolverHookFactory resolverHookFactory = new RegionResolverHookFactory(this.regionDigraph);
+ this.state.setResolverHookFactory(resolverHookFactory);
}
/**

Back to the top