Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2010-12-29 07:14:14 -0500
committerGlyn Normington2010-12-29 07:14:14 -0500
commit43ec52be93286631fb47ebb5fffda462fcea9092 (patch)
tree8034bae8c168324155cb3b803cc1f4d926fa04fb /org.eclipse.virgo.kernel.agent.dm
parentaee4936b7dd8e8dc19bff03b701266a84417fa9b (diff)
downloadorg.eclipse.virgo.kernel-43ec52be93286631fb47ebb5fffda462fcea9092.tar.gz
org.eclipse.virgo.kernel-43ec52be93286631fb47ebb5fffda462fcea9092.tar.xz
org.eclipse.virgo.kernel-43ec52be93286631fb47ebb5fffda462fcea9092.zip
bug 330776: delete old methods from RegionMembership interface
Diffstat (limited to 'org.eclipse.virgo.kernel.agent.dm')
-rw-r--r--org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/DeployerFailureListener.java24
1 files changed, 17 insertions, 7 deletions
diff --git a/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/DeployerFailureListener.java b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/DeployerFailureListener.java
index dda9f689..f11e0bf6 100644
--- a/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/DeployerFailureListener.java
+++ b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/DeployerFailureListener.java
@@ -11,6 +11,11 @@
package org.eclipse.virgo.kernel.agent.dm.internal;
+import org.eclipse.virgo.kernel.osgi.region.IndeterminateRegionException;
+import org.eclipse.virgo.kernel.osgi.region.Region;
+import org.eclipse.virgo.kernel.osgi.region.RegionMembership;
+import org.eclipse.virgo.kernel.serviceability.Assert;
+import org.eclipse.virgo.medic.eventlog.EventLogger;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
@@ -18,9 +23,6 @@ import org.osgi.framework.ServiceReference;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;
-import org.eclipse.virgo.kernel.osgi.region.RegionMembership;
-import org.eclipse.virgo.medic.eventlog.EventLogger;
-
/**
* A {@link EventHandler} implementation that listens for and handles Blueprint container failure events.
* <p />
@@ -39,10 +41,10 @@ final class DeployerFailureListener implements EventHandler {
private static final String FAILURE_TOPIC = "org/osgi/service/blueprint/container/FAILURE";
private final EventLogger eventLogger;
-
+
private volatile RegionMembership regionMembership;
- private volatile boolean agentInRegion;
+ private volatile Region agentRegion;
public DeployerFailureListener(EventLogger eventLogger) {
this.eventLogger = eventLogger;
@@ -68,10 +70,18 @@ final class DeployerFailureListener implements EventHandler {
ServiceReference<RegionMembership> regionMembershipServiceReference = bundleContext.getServiceReference(RegionMembership.class);
if (regionMembershipServiceReference != null) {
this.regionMembership = bundleContext.getService(regionMembershipServiceReference);
- this.agentInRegion = this.regionMembership.contains(agentBundle);
+ try {
+ this.agentRegion = this.regionMembership.getRegion(agentBundle);
+ } catch (IndeterminateRegionException e) {
+ Assert.isTrue(false, "Indeterminate agent region");
+ }
}
}
- return this.regionMembership != null ? this.regionMembership.contains(bundle) == this.agentInRegion : true;
+ try {
+ return this.regionMembership != null ? this.regionMembership.getRegion(bundle).equals(this.agentRegion) : true;
+ } catch (IndeterminateRegionException e) {
+ return true;
+ }
}
}

Back to the top