Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2011-04-28 15:37:27 +0000
committerChristopher Frost2011-04-28 15:37:27 +0000
commit5829b0a850bb0743f692cccea4061ca07fce6c9c (patch)
tree528f7d5a46e8b7d3b6e7354cbfef7b332f127db8 /org.eclipse.virgo.kernel.model/src
parent7fdf3549ec8824f9911e70239955f64bde1b830c (diff)
downloadorg.eclipse.virgo.kernel-5829b0a850bb0743f692cccea4061ca07fce6c9c.tar.gz
org.eclipse.virgo.kernel-5829b0a850bb0743f692cccea4061ca07fce6c9c.tar.xz
org.eclipse.virgo.kernel-5829b0a850bb0743f692cccea4061ca07fce6c9c.zip
Fixes to Model listeners and making the RegionDigraph strict on null input
Diffstat (limited to 'org.eclipse.virgo.kernel.model/src')
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListener.java2
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListenerInitializer.java10
2 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListener.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListener.java
index 7d1e43e1..57cccc7e 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListener.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListener.java
@@ -118,7 +118,7 @@ class ModelInstallArtifactLifecycleListener extends InstallArtifactLifecycleList
private void remove(InstallArtifact installArtifact) {
if(installArtifact instanceof BundleInstallArtifact){
- this.artifactRepository.remove(installArtifact.getType(), installArtifact.getName(), installArtifact.getVersion(), this.regionDigraph.getRegion(((BundleInstallArtifact) installArtifact).getBundle()));
+ this.artifactRepository.remove(installArtifact.getType(), installArtifact.getName(), installArtifact.getVersion(), this.regionDigraph.getRegion(USER_REGION_NAME));
} else {
this.artifactRepository.remove(installArtifact.getType(), installArtifact.getName(), installArtifact.getVersion(), null);
}
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListenerInitializer.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListenerInitializer.java
index aa830b59..41b25277 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListenerInitializer.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/ModelInstallArtifactLifecycleListenerInitializer.java
@@ -41,6 +41,8 @@ import org.eclipse.virgo.util.osgi.ServiceRegistrationTracker;
* @see ModelInstallArtifactLifecycleListener
*/
public final class ModelInstallArtifactLifecycleListenerInitializer {
+
+ private static final String USER_REGION_NAME = "org.eclipse.virgo.region.user";
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -68,8 +70,7 @@ public final class ModelInstallArtifactLifecycleListenerInitializer {
*/
@PostConstruct
public void initialize() {
- ModelInstallArtifactLifecycleListener listener = new ModelInstallArtifactLifecycleListener(this.bundleContext, this.artifactRepository,
- this.regionDigraph);
+ ModelInstallArtifactLifecycleListener listener = new ModelInstallArtifactLifecycleListener(this.bundleContext, this.artifactRepository, this.regionDigraph);
this.registrationTracker.track(this.bundleContext.registerService(InstallArtifactLifecycleListener.class.getCanonicalName(), listener, null));
for (DeploymentIdentity deploymentIdentity : this.runtimeArtifactModel.getDeploymentIdentities()) {
InstallArtifact installArtifact = this.runtimeArtifactModel.get(deploymentIdentity);
@@ -77,10 +78,9 @@ public final class ModelInstallArtifactLifecycleListenerInitializer {
if (installArtifact instanceof PlanInstallArtifact) {
this.artifactRepository.add(new DeployerCompositeArtifact(this.bundleContext, (PlanInstallArtifact) installArtifact));
} else if (installArtifact instanceof BundleInstallArtifact) {
- this.artifactRepository.remove(installArtifact.getType(), installArtifact.getName(), installArtifact.getVersion(), null);
+ this.artifactRepository.remove(installArtifact.getType(), installArtifact.getName(), installArtifact.getVersion(), this.regionDigraph.getRegion(USER_REGION_NAME));
BundleInstallArtifact bundleInstallArtifact = (BundleInstallArtifact) installArtifact;
- this.artifactRepository.add(new DeployerBundleArtifact(this.bundleContext, bundleInstallArtifact,
- this.regionDigraph.getRegion(bundleInstallArtifact.getBundle())));
+ this.artifactRepository.add(new DeployerBundleArtifact(this.bundleContext, bundleInstallArtifact, this.regionDigraph.getRegion(USER_REGION_NAME)));
} else {
this.artifactRepository.remove(installArtifact.getType(), installArtifact.getName(), installArtifact.getVersion(), null);
this.artifactRepository.add(new DeployerArtifact(this.bundleContext, installArtifact));

Back to the top