Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Waibel2014-05-01 17:23:52 -0400
committerFlorian Waibel2014-07-18 04:34:17 -0400
commit97e23c2f0061de0659b08185a344a6ecd1efea05 (patch)
tree49e4d259048ed603817de65f52e1484abecac454
parent2d596ff02dfa582c9d58dd74c30b2616805cd5b9 (diff)
downloadorg.eclipse.virgo.kernel-97e23c2f0061de0659b08185a344a6ecd1efea05.tar.gz
org.eclipse.virgo.kernel-97e23c2f0061de0659b08185a344a6ecd1efea05.tar.xz
org.eclipse.virgo.kernel-97e23c2f0061de0659b08185a344a6ecd1efea05.zip
426389 Adds configurable scan interval for hot deployer
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/config/org.eclipse.virgo.kernel.properties1
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/configTimeout/org.eclipse.virgo.kernel.properties1
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/StandardDeployerConfiguration.java31
-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/deployer/core/internal/DeployerBlockingSignalTests.java6
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties1
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties1
7 files changed, 30 insertions, 12 deletions
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 50e50309..7c8dd56d 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,5 +1,6 @@
deployer.timeout= 300
deployer.pickupDirectory= target/pickup
+deployer.scanIntervalMillis=1000
deployer.systemArtifacts=
deployer.unpackBundles=false
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/configTimeout/org.eclipse.virgo.kernel.properties b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/configTimeout/org.eclipse.virgo.kernel.properties
index c224801f..132ac38e 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/configTimeout/org.eclipse.virgo.kernel.properties
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/configTimeout/org.eclipse.virgo.kernel.properties
@@ -1,5 +1,6 @@
deployer.timeout= 0
deployer.pickupDirectory= target/pickup
+deployer.scanIntervalMillis=1000
io.workDirectory= target/work
io.dumpDirectory= target/serviceability/dump
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/StandardDeployerConfiguration.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/StandardDeployerConfiguration.java
index fba1f190..53398325 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/StandardDeployerConfiguration.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/StandardDeployerConfiguration.java
@@ -25,21 +25,26 @@ import org.eclipse.virgo.util.io.PathReference;
* This class is thread safe.
*
*/
-final class StandardDeployerConfiguration implements DeployerConfiguration {
+final class StandardDeployerConfiguration implements DeployerConfiguration {
private final int deploymentTimeoutSeconds;
+
private final PathReference deploymentPickupDirectory;
-
+
+ private final int scanIntervalMillis;
+
/**
- * Construct a deployment configuration using the given <code>deploymentTimeout</code>,
- * and <code>pickupDirectory</code>.
+ * Construct a deployment configuration using the given <code>deploymentTimeout</code>, <code>pickupDirectory</code>
+ * and <code>scanIntervalMillis</code>.
*
* @param deploymentTimeout The timeout period, in seconds
* @param pickupDirectory The deployer's pickup directory
+ * @param scanIntervalMillis The deployer's scan interval in milliseconds
*/
- StandardDeployerConfiguration(int deploymentTimeout, File pickupDirectory) {
+ StandardDeployerConfiguration(int deploymentTimeout, File pickupDirectory, int scanIntervalMillis) {
this.deploymentTimeoutSeconds = deploymentTimeout;
this.deploymentPickupDirectory = new PathReference(pickupDirectory);
+ this.scanIntervalMillis = scanIntervalMillis;
}
/**
@@ -48,18 +53,26 @@ final class StandardDeployerConfiguration implements DeployerConfiguration {
public int getDeploymentTimeoutSeconds() {
return this.deploymentTimeoutSeconds;
}
-
+
/**
* {@inheritDoc}
*/
public PathReference getDeploymentPickupDirectory() {
return this.deploymentPickupDirectory;
}
-
- /**
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getScanIntervalMillis() {
+ return this.scanIntervalMillis;
+ }
+
+ /**
* {@inheritDoc}
*/
public String toString() {
- return String.format("Timeout: '%s', Pickup directory: '%s'", this.deploymentTimeoutSeconds, this.deploymentPickupDirectory);
+ return String.format("Timeout: '%s', Pickup directory: '%s', Scan interval in millis: '%s'", this.deploymentTimeoutSeconds,
+ this.deploymentPickupDirectory, this.scanIntervalMillis);
}
}
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 eb6780a3..67ff50d4 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
@@ -191,6 +191,7 @@
class="org.eclipse.virgo.kernel.deployer.core.internal.StandardDeployerConfiguration">
<beans:constructor-arg value="#{kernelConfig.getProperty('deployer.timeout')}" />
<beans:constructor-arg value="#{kernelConfig.getProperty('deployer.pickupDirectory')}" />
+ <beans:constructor-arg value="#{kernelConfig.getProperty('deployer.scanIntervalMillis')}" />
</beans:bean>
<service ref="deployerConfig"
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/DeployerBlockingSignalTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/DeployerBlockingSignalTests.java
index fa6c2034..f7c68110 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/DeployerBlockingSignalTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/DeployerBlockingSignalTests.java
@@ -32,11 +32,11 @@ public class DeployerBlockingSignalTests {
@Test
public void testAwaitCompletionBlock() throws DeploymentException {
BlockingSignal blockingSignal = new BlockingSignal(true);
- long start = System.currentTimeMillis();
+ long start = System.nanoTime();
boolean awaitCompletion = blockingSignal.awaitCompletion(TEST_PERIOD);
- long finish = System.currentTimeMillis();
+ long finish = System.nanoTime();
assertFalse(awaitCompletion);
- assertTrue(finish - start > TEST_PERIOD * 1000);
+ assertTrue(finish - start > TEST_PERIOD * 1000 * 1000);
}
/**
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties
index 9d192332..a1dcae0c 100644
--- a/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties
@@ -1,3 +1,4 @@
deployer.timeout= 300
deployer.pickupDirectory= target/pickup
+deployer.scanIntervalMillis=1000
deployer.systemArtifacts=
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties b/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties
index 9412c860..904b0628 100644
--- a/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties
@@ -1,5 +1,6 @@
deployer.timeout= 300
deployer.pickupDirectory= target/pickup
+deployer.scanIntervalMillis=1000
io.workDirectory= target/work
io.dumpDirectory= target/serviceability/dump
profile.name= subsystem installation test

Back to the top