426389 Adds configurable scan interval for hot deployer
diff --git a/org.eclipse.virgo.nano.deployer.api/src/main/java/org/eclipse/virgo/nano/deployer/api/core/DeployerConfiguration.java b/org.eclipse.virgo.nano.deployer.api/src/main/java/org/eclipse/virgo/nano/deployer/api/core/DeployerConfiguration.java
index 22708d6..f0093b9 100644
--- a/org.eclipse.virgo.nano.deployer.api/src/main/java/org/eclipse/virgo/nano/deployer/api/core/DeployerConfiguration.java
+++ b/org.eclipse.virgo.nano.deployer.api/src/main/java/org/eclipse/virgo/nano/deployer/api/core/DeployerConfiguration.java
@@ -28,7 +28,7 @@
     /**
      * Get the configured deployment timeout.
      * 
-     * @return the timeout in seconds
+     * @return the timeout in seconds.
      */
     int getDeploymentTimeoutSeconds();
 
@@ -38,4 +38,11 @@
      * @return the pickup directory as a {@link PathReference}.
      */
     PathReference getDeploymentPickupDirectory();
+
+    /**
+     * Get the configured scan interval.
+     *
+     * @return the scan interval in milliseconds.
+     */
+    int getScanIntervalMillis();
 }
diff --git a/org.eclipse.virgo.nano.deployer.hot/src/main/java/org/eclipse/virgo/nano/deployer/hot/HotDeployer.java b/org.eclipse.virgo.nano.deployer.hot/src/main/java/org/eclipse/virgo/nano/deployer/hot/HotDeployer.java
index a377955..6fd30ef 100644
--- a/org.eclipse.virgo.nano.deployer.hot/src/main/java/org/eclipse/virgo/nano/deployer/hot/HotDeployer.java
+++ b/org.eclipse.virgo.nano.deployer.hot/src/main/java/org/eclipse/virgo/nano/deployer/hot/HotDeployer.java
@@ -53,7 +53,7 @@
     public HotDeployer(@NonNull DeployerConfiguration deployerConfiguration, @NonNull ApplicationDeployer deployer, EventLogger eventLogger) {
         this.pickupDir = createHotDeployDir(deployerConfiguration.getDeploymentPickupDirectory());
         FileSystemChecker checker = createFileSystemChecker(deployer, eventLogger);
-        this.thread = new Thread(new WatchTask(checker, this.pickupDir), "fs-watcher");
+        this.thread = new Thread(new WatchTask(checker, this.pickupDir, deployerConfiguration.getScanIntervalMillis()), "fs-watcher");
     }
 
 	private FileSystemChecker createFileSystemChecker(ApplicationDeployer deployer, EventLogger eventLogger) {
diff --git a/org.eclipse.virgo.nano.deployer.hot/src/main/java/org/eclipse/virgo/nano/deployer/hot/WatchTask.java b/org.eclipse.virgo.nano.deployer.hot/src/main/java/org/eclipse/virgo/nano/deployer/hot/WatchTask.java
index f70cfa2..39d0eab 100644
--- a/org.eclipse.virgo.nano.deployer.hot/src/main/java/org/eclipse/virgo/nano/deployer/hot/WatchTask.java
+++ b/org.eclipse.virgo.nano.deployer.hot/src/main/java/org/eclipse/virgo/nano/deployer/hot/WatchTask.java
@@ -21,15 +21,16 @@
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    private final int scanIntervalMillis = 1000;
+    private final int scanIntervalMillis;
 
     private final FileSystemChecker checker;
 
     private final File watchDir;
 
-    WatchTask(FileSystemChecker checker, File watchDir) {
+    WatchTask(FileSystemChecker checker, File watchDir, int scanIntervalMillis) {
         this.checker = checker;
         this.watchDir = watchDir;
+        this.scanIntervalMillis = scanIntervalMillis;
     }
 
     /**
diff --git a/org.eclipse.virgo.nano.deployer/src/main/java/org/eclipse/virgo/nano/deployer/internal/StandardApplicationDeployer.java b/org.eclipse.virgo.nano.deployer/src/main/java/org/eclipse/virgo/nano/deployer/internal/StandardApplicationDeployer.java
index 09ffcdb..224812e 100644
--- a/org.eclipse.virgo.nano.deployer/src/main/java/org/eclipse/virgo/nano/deployer/internal/StandardApplicationDeployer.java
+++ b/org.eclipse.virgo.nano.deployer/src/main/java/org/eclipse/virgo/nano/deployer/internal/StandardApplicationDeployer.java
@@ -80,7 +80,8 @@
     private void initialiseHotDeployer() {
         int deployerTimeout = Integer.valueOf(this.kernelConfig.getProperty("deployer.timeout"));
         String pickupDirectory = this.kernelConfig.getProperty("deployer.pickupDirectory");
-        DeployerConfiguration deployerConfiguration = new StandardDeployerConfiguration(deployerTimeout, new File(pickupDirectory));
+        int scanInterval = Integer.valueOf(this.kernelConfig.getProperty("deployer.scanIntervalMillis"));
+        DeployerConfiguration deployerConfiguration = new StandardDeployerConfiguration(deployerTimeout, new File(pickupDirectory), scanInterval);
         this.hotDeployerEnabler = new HotDeployerEnabler(this, deployerConfiguration, this.eventLogger);
         this.hotDeployerEnabler.startHotDeployer();
     }
diff --git a/org.eclipse.virgo.nano.deployer/src/main/java/org/eclipse/virgo/nano/deployer/internal/StandardDeployerConfiguration.java b/org.eclipse.virgo.nano.deployer/src/main/java/org/eclipse/virgo/nano/deployer/internal/StandardDeployerConfiguration.java
index 925ad55..274ca4d 100644
--- a/org.eclipse.virgo.nano.deployer/src/main/java/org/eclipse/virgo/nano/deployer/internal/StandardDeployerConfiguration.java
+++ b/org.eclipse.virgo.nano.deployer/src/main/java/org/eclipse/virgo/nano/deployer/internal/StandardDeployerConfiguration.java
@@ -1,3 +1,4 @@
+
 package org.eclipse.virgo.nano.deployer.internal;
 
 /*******************************************************************************
@@ -26,21 +27,26 @@
  * This class is thread safe.
  * 
  */
-public final class StandardDeployerConfiguration implements DeployerConfiguration {    
+public 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>, and
+     * <code>pickupDirectory</code>.
      * 
      * @param deploymentTimeout The timeout period, in seconds
      * @param pickupDirectory The deployer's pickup directory
+     * @param scanIntervalMillis The deployer's scan interval in milliseconds
      */
-    public StandardDeployerConfiguration(int deploymentTimeout, File pickupDirectory) {        
+    public StandardDeployerConfiguration(int deploymentTimeout, File pickupDirectory, int scanIntervalMillis) {
         this.deploymentTimeoutSeconds = deploymentTimeout;
         this.deploymentPickupDirectory = new PathReference(pickupDirectory);
+        this.scanIntervalMillis = scanIntervalMillis;
     }
 
     /**
@@ -49,18 +55,27 @@
     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", this.deploymentTimeoutSeconds,
+            this.deploymentPickupDirectory, this.scanIntervalMillis);
     }
+
 }