Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-10-03 08:21:43 +0000
committerGlyn Normington2011-10-03 08:21:43 +0000
commit42a8c97778350aa14065cdb6a778065bbe5821d9 (patch)
tree3527bdff204a1532e07af1e9165820a5b7b50193 /org.eclipse.virgo.kernel.model/src
parent25d9b2e289a6d39cbb31ee06bede34e17c03e4d2 (diff)
downloadorg.eclipse.virgo.kernel-42a8c97778350aa14065cdb6a778065bbe5821d9.tar.gz
org.eclipse.virgo.kernel-42a8c97778350aa14065cdb6a778065bbe5821d9.tar.xz
org.eclipse.virgo.kernel-42a8c97778350aa14065cdb6a778065bbe5821d9.zip
bug 353996: user region support
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/DeployerConfigArtifact.java40
1 files changed, 35 insertions, 5 deletions
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerConfigArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerConfigArtifact.java
index b3f0d513..fc00b2bd 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerConfigArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerConfigArtifact.java
@@ -11,8 +11,14 @@
package org.eclipse.virgo.kernel.model.internal.deployer;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
import org.eclipse.equinox.region.Region;
-import org.eclipse.virgo.kernel.install.artifact.InstallArtifact;
+import org.eclipse.virgo.kernel.install.artifact.ConfigInstallArtifact;
import org.osgi.framework.BundleContext;
@@ -26,11 +32,35 @@ import org.osgi.framework.BundleContext;
*/
final class DeployerConfigArtifact extends DeployerArtifact {
- private final InstallArtifact installArtifact;
+ private final ConfigInstallArtifact configInstallArtifact;
+
+ public DeployerConfigArtifact(BundleContext bundleContext, ConfigInstallArtifact configInstallArtifact, Region region) {
+ super(bundleContext, configInstallArtifact, region);
+ this.configInstallArtifact = configInstallArtifact;
+ }
- public DeployerConfigArtifact(BundleContext bundleContext, InstallArtifact installArtifact, Region region) {
- super(bundleContext, installArtifact, region);
- this.installArtifact = installArtifact;
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Map<String, String> getProperties() {
+ Map<String, String> properties = new HashMap<String, String>(super.getProperties());
+ try {
+ Properties props = this.configInstallArtifact.getProperties();
+ Enumeration keys = props.keys();
+ while (keys.hasMoreElements()) {
+ Object key = keys.nextElement();
+ if (key instanceof String) {
+ Object value = props.get(key);
+ if (value instanceof String) {
+ properties.put((String)key, (String)value);
+ }
+ }
+ }
+ } catch (IOException _) {
+ // Default to superclass behaviour
+ }
+ return properties;
}

Back to the top