camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r817190 - in /camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset: DataSetConsumer.java DataSetEndpoint.java
Date Mon, 21 Sep 2009 08:22:47 GMT
Author: davsclaus
Date: Mon Sep 21 08:22:42 2009
New Revision: 817190

URL: http://svn.apache.org/viewvc?rev=817190&view=rev
Log:
CAMEL-2031: Added initial delay for data set

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java?rev=817190&r1=817189&r2=817190&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetConsumer.java
Mon Sep 21 08:22:42 2009
@@ -49,6 +49,15 @@
 
         endpoint.getExecutorService().execute(new Runnable() {
             public void run() {
+                if (endpoint.getInitialDelay() > 0) {
+                    try {
+                        Thread.sleep(endpoint.getInitialDelay());
+                    } catch (InterruptedException e) {
+                        Thread.currentThread().interrupt();
+                        return;
+                    }
+                }
+
                 sendMessages(preloadSize, dataSet.getSize());
             }
         });

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java?rev=817190&r1=817189&r2=817190&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
Mon Sep 21 08:22:42 2009
@@ -44,6 +44,7 @@
     private long produceDelay = 3;
     private long consumeDelay;
     private long preloadSize;
+    private long initialDelay = 1000;
     private Processor reporter;
 
     public DataSetEndpoint() {
@@ -170,6 +171,13 @@
         this.reporter = reporter;
     }
 
+    public long getInitialDelay() {
+        return initialDelay;
+    }
+
+    public void setInitialDelay(long initialDelay) {
+        this.initialDelay = initialDelay;
+    }
 
     // Implementation methods
     //-------------------------------------------------------------------------



Mime
View raw message