Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2012-07-20 03:50:57 -0400
committerGlyn Normington2012-07-20 03:50:57 -0400
commitb6a3e55dbfdea4c30d7adcbddfd3e02dd80db9bb (patch)
treef2cb7bfc476014b4b968cdba600d3a544b268a58
parente971fc3ba87347bcf0cc2fa44bb11063875020fd (diff)
downloadorg.eclipse.virgo.kernel-b6a3e55dbfdea4c30d7adcbddfd3e02dd80db9bb.tar.gz
org.eclipse.virgo.kernel-b6a3e55dbfdea4c30d7adcbddfd3e02dd80db9bb.tar.xz
org.eclipse.virgo.kernel-b6a3e55dbfdea4c30d7adcbddfd3e02dd80db9bb.zip
383875: make unpacking configurable via deployer.unpackBundles=true but not the default behaviour
-rw-r--r--org.eclipse.virgo.kernel.agent.dm/.classpath2
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.properties2
-rw-r--r--org.eclipse.virgo.kernel.deployer/.classpath2
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java16
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorageFactory.java9
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml1
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardInstallArtifactGraphInclosureTests.java2
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java2
8 files changed, 26 insertions, 10 deletions
diff --git a/org.eclipse.virgo.kernel.agent.dm/.classpath b/org.eclipse.virgo.kernel.agent.dm/.classpath
index e91ff381..d1bc6611 100644
--- a/org.eclipse.virgo.kernel.agent.dm/.classpath
+++ b/org.eclipse.virgo.kernel.agent.dm/.classpath
@@ -43,6 +43,6 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.mirrored/org.eclipse.equinox.event/1.2.100.v20111010-1614/org.eclipse.equinox.event-1.2.100.v20111010-1614.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.mirrored/org.eclipse.equinox.region/1.1.0.v20120319-1602/org.eclipse.equinox.region-1.1.0.v20120319-1602.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.osgi/org.eclipse.equinox.region/1.0.0.v20110503/org.eclipse.equinox.region-1.0.0.v20110503.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.mirrored/org.eclipse.osgi.services/3.3.0.v20120307-2102/org.eclipse.osgi.services-3.3.0.v20120307-2102.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi.services/3.3.0.v20110513/org.eclipse.osgi.services-sources-3.3.0.v20110513.jar"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.nano/org.eclipse.virgo.kernel.core/3.6.0.D-20120717202758/org.eclipse.virgo.kernel.core-3.6.0.D-20120717202758.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.nano/org.eclipse.virgo.kernel.core/3.5.0.D-20120615071853/org.eclipse.virgo.kernel.core-sources-3.5.0.D-20120615071853.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.nano/org.eclipse.virgo.kernel.core/3.6.0.D-20120717202758/org.eclipse.virgo.kernel.core-3.6.0.D-20120717202758.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.nano/org.eclipse.virgo.kernel.core/3.6.0.D-20120717202758/org.eclipse.virgo.kernel.core-sources-3.6.0.D-20120717202758.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.properties b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.properties
index 9d192332..a9088e88 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.properties
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.properties
@@ -1,3 +1,5 @@
deployer.timeout= 300
deployer.pickupDirectory= target/pickup
deployer.systemArtifacts=
+deployer.unpackBundles=true
+
diff --git a/org.eclipse.virgo.kernel.deployer/.classpath b/org.eclipse.virgo.kernel.deployer/.classpath
index 57299110..1509c9dc 100644
--- a/org.eclipse.virgo.kernel.deployer/.classpath
+++ b/org.eclipse.virgo.kernel.deployer/.classpath
@@ -46,7 +46,7 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic.core/3.6.0.D-20120717201225/org.eclipse.virgo.medic.core-3.6.0.D-20120717201225.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic.core/3.5.0.D-20120615070622/org.eclipse.virgo.medic.core-sources-3.5.0.D-20120615070622.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.mirrored/org.slf4j.api/1.6.4.v20120130-2120/org.slf4j.api-1.6.4.v20120130-2120.jar" sourcepath="/KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.nop/1.6.1/com.springsource.slf4j.nop-1.6.1.jar" sourcepath="/KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.nop/1.6.1/com.springsource.slf4j.nop-sources-1.6.1.jar"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic.test/3.6.0.D-20120717201225/org.eclipse.virgo.medic.test-3.6.0.D-20120717201225.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic.test/3.5.0.D-20120615070622/org.eclipse.virgo.medic.test-sources-3.5.0.D-20120615070622.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic.test/3.6.0.D-20120711093918/org.eclipse.virgo.medic.test-3.6.0.D-20120711093918.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic.test/3.5.0.D-20120615070622/org.eclipse.virgo.medic.test-sources-3.5.0.D-20120615070622.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.teststubs/org.eclipse.virgo.teststubs.osgi/3.6.0.D-20120711092322/org.eclipse.virgo.teststubs.osgi-3.6.0.D-20120711092322.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.teststubs/org.eclipse.virgo.teststubs.osgi/1.0.0.CI-B39/org.eclipse.virgo.teststubs.osgi-sources-1.0.0.CI-B39.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.kernel.osgi"/>
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java
index 94d7dbc7..78fa686e 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java
@@ -28,7 +28,11 @@ import org.eclipse.virgo.util.io.PathReference;
final class StandardArtifactStorage implements ArtifactStorage {
- private static final List<String> UNPACK_EXTENSIONS = Arrays.asList("par", "zip");
+ private static final String DEPLOYER_UNPACK_BUNDLES_TRUE = "true";
+
+ private static final List<String> ALWAYS_UNPACKED_EXTENSIONS = Arrays.asList("par", "zip");
+
+ private static final List<String> CONFIGURABLY_UNPACKED_EXTENSIONS = Arrays.asList("jar", "war");
private final PathReference sourcePathReference;
@@ -40,10 +44,12 @@ final class StandardArtifactStorage implements ArtifactStorage {
private final EventLogger eventLogger;
+ private final boolean unpackBundles;
+
private final Object monitor = new Object();
public StandardArtifactStorage(PathReference sourcePathReference, PathReference baseStagingPathReference, ArtifactFSFactory artifactFSFactory,
- EventLogger eventLogger) {
+ EventLogger eventLogger, String unpackBundlesOption) {
this.sourcePathReference = sourcePathReference;
this.baseStagingPathReference = baseStagingPathReference;
@@ -51,6 +57,8 @@ final class StandardArtifactStorage implements ArtifactStorage {
this.eventLogger = eventLogger;
+ this.unpackBundles = (unpackBundlesOption == null) || DEPLOYER_UNPACK_BUNDLES_TRUE.equalsIgnoreCase(unpackBundlesOption);
+
synchronize(this.sourcePathReference, false);
this.artifactFS = artifactFSFactory.create(this.baseStagingPathReference.toFile());
}
@@ -108,7 +116,9 @@ final class StandardArtifactStorage implements ArtifactStorage {
if (dotLocation == -1) {
return false;
}
- return UNPACK_EXTENSIONS.contains(fileName.substring(dotLocation + 1));
+ String fileExtension = fileName.substring(dotLocation + 1);
+ // Always unpack .par/.zip. Unpack .jar/.war if and only if kernel property deployer.unpackBundles is either not specified or is "true"
+ return ALWAYS_UNPACKED_EXTENSIONS.contains(fileExtension) || (this.unpackBundles && CONFIGURABLY_UNPACKED_EXTENSIONS.contains(fileExtension));
}
private void stashContent() {
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorageFactory.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorageFactory.java
index e65fb0cd..9d56ed32 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorageFactory.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorageFactory.java
@@ -40,25 +40,28 @@ public final class StandardArtifactStorageFactory implements ArtifactStorageFact
private final ArtifactFSFactory artifactFSFactory;
private final EventLogger eventLogger;
+
+ private final String unpackBundles;
- public StandardArtifactStorageFactory(PathReference workDirectory, ArtifactFSFactory artifactFSFactory, EventLogger eventLogger) {
+ public StandardArtifactStorageFactory(PathReference workDirectory, ArtifactFSFactory artifactFSFactory, EventLogger eventLogger, String unpackBundles) {
this.workDirectory = workDirectory;
this.artifactFSFactory = artifactFSFactory;
this.eventLogger = eventLogger;
+ this.unpackBundles = unpackBundles;
}
public ArtifactStorage create(File file, ArtifactIdentity artifactIdentity) {
PathReference sourcePathReference = new PathReference(file);
PathReference stagingPathReference = createStagingPathReference(artifactIdentity, file.getName());
- return new StandardArtifactStorage(sourcePathReference, stagingPathReference, this.artifactFSFactory, this.eventLogger);
+ return new StandardArtifactStorage(sourcePathReference, stagingPathReference, this.artifactFSFactory, this.eventLogger, this.unpackBundles);
}
public ArtifactStorage createDirectoryStorage(ArtifactIdentity artifactIdentity, String directoryName) {
PathReference stagingPathReference = createStagingPathReference(artifactIdentity, directoryName);
stagingPathReference.createDirectory();
- return new StandardArtifactStorage(null, stagingPathReference, this.artifactFSFactory, this.eventLogger);
+ return new StandardArtifactStorage(null, stagingPathReference, this.artifactFSFactory, this.eventLogger, this.unpackBundles);
}
private PathReference createStagingPathReference(ArtifactIdentity artifactIdentity, String name) {
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml b/org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml
index a70ca508..8ea6dc06 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml
+++ b/org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml
@@ -27,6 +27,7 @@
class="org.eclipse.virgo.kernel.artifact.fs.StandardArtifactFSFactory" />
</beans:constructor-arg>
<beans:constructor-arg ref="eventLogger" />
+ <beans:constructor-arg value="#{kernelConfig.getProperty('deployer.unpackBundles')}" />
</beans:bean>
<beans:bean id="syntheticContextCreatingTransformer"
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardInstallArtifactGraphInclosureTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardInstallArtifactGraphInclosureTests.java
index 5b3ca5fe..f02a9023 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardInstallArtifactGraphInclosureTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardInstallArtifactGraphInclosureTests.java
@@ -85,7 +85,7 @@ public class StandardInstallArtifactGraphInclosureTests {
private RepositoryAwareArtifactDescriptor artifactDescriptor;
private final ArtifactStorageFactory artifactStorageFactory = new StandardArtifactStorageFactory(
- new PathReference("target/work/deployer.staging"), new StandardArtifactFSFactory(), new MockEventLogger());
+ new PathReference("target/work/deployer.staging"), new StandardArtifactFSFactory(), new MockEventLogger(), "true");
private Set<ArtifactBridge> testArtifactBridges = new HashSet<ArtifactBridge>();
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java
index 1b23eea2..2a4151cb 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java
@@ -65,7 +65,7 @@ public final class SyntheticContextBundleCreatingTransformerTests {
private final InstallEnvironment installEnvironment = createMock(InstallEnvironment.class);
private final ArtifactStorageFactory artifactStorageFactory = new StandardArtifactStorageFactory(new PathReference("target/work"),
- new StandardArtifactFSFactory(), new MockEventLogger());
+ new StandardArtifactFSFactory(), new MockEventLogger(), "true");
private final Transformer transformer = new SyntheticContextBundleCreatingTransformer(this.installArtifactGraphFactory,
this.artifactStorageFactory);

Back to the top