camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/4] camel git commit: CAMEL-7953: hazelcast pollInterval is really pollTimeout.
Date Sun, 30 Nov 2014 14:42:39 GMT
CAMEL-7953: hazelcast pollInterval is really pollTimeout.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f6123ec0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f6123ec0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f6123ec0

Branch: refs/heads/master
Commit: f6123ec0e1d3fdf07e4021b364e1a45d0ede33f5
Parents: 76c8352
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Nov 30 15:07:58 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Nov 30 15:07:58 2014 +0100

----------------------------------------------------------------------
 .../seda/HazelcastSedaConfiguration.java        | 22 +++++++++++++++++---
 .../hazelcast/seda/HazelcastSedaConsumer.java   |  2 +-
 .../HazelcastSedaConfigurationTest.java         |  8 +++----
 3 files changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f6123ec0/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
index 5e6f16a..3d9d1d8 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
@@ -22,7 +22,7 @@ package org.apache.camel.component.hazelcast.seda;
 public class HazelcastSedaConfiguration {
 
     private int concurrentConsumers = 1;
-    private int pollInterval = 1000;
+    private int pollTimeout = 1000;
     private String queueName;
     private boolean transferExchange;
     private boolean transacted;
@@ -46,12 +46,28 @@ public class HazelcastSedaConfiguration {
         this.queueName = queueName;
     }
 
+    /**
+     * @deprecated use pollTimeout instead
+     */
+    @Deprecated
     public int getPollInterval() {
-        return pollInterval;
+        return pollTimeout;
     }
 
+    /**
+     * @deprecated use pollTimeout instead
+     */
+    @Deprecated
     public void setPollInterval(int pollInterval) {
-        this.pollInterval = pollInterval;
+        this.pollTimeout = pollInterval;
+    }
+
+    public int getPollTimeout() {
+        return pollTimeout;
+    }
+
+    public void setPollTimeout(int pollTimeout) {
+        this.pollTimeout = pollTimeout;
     }
 
     public boolean isTransferExchange() {

http://git-wip-us.apache.org/repos/asf/camel/blob/f6123ec0/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
index 9ab4fd1..4dd99a1 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
@@ -87,7 +87,7 @@ public class HazelcastSedaConsumer extends DefaultConsumer implements Runnable
{
                 }
             }
             try {
-                final Object body = queue.poll(endpoint.getConfiguration().getPollInterval(),
TimeUnit.MILLISECONDS);
+                final Object body = queue.poll(endpoint.getConfiguration().getPollTimeout(),
TimeUnit.MILLISECONDS);
 
                 if (body != null) {
                     if (body instanceof DefaultExchangeHolder) {

http://git-wip-us.apache.org/repos/asf/camel/blob/f6123ec0/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastSedaConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastSedaConfigurationTest.java
b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastSedaConfigurationTest.java
index aa751ea..43eb8f9 100644
--- a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastSedaConfigurationTest.java
+++ b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastSedaConfigurationTest.java
@@ -41,7 +41,7 @@ public class HazelcastSedaConfigurationTest extends CamelTestSupport {
 
         assertEquals("Invalid queue name", "foo", hzlqEndpoint.getConfiguration().getQueueName());
         assertEquals("Default value of concurrent consumers is invalid", 1, hzlqEndpoint.getConfiguration().getConcurrentConsumers());
-        assertEquals("Default value of pool interval is invalid", 1000, hzlqEndpoint.getConfiguration().getPollInterval());
+        assertEquals("Default value of pool timeout is invalid", 1000, hzlqEndpoint.getConfiguration().getPollTimeout());
     }
 
     @Test
@@ -50,16 +50,16 @@ public class HazelcastSedaConfigurationTest extends CamelTestSupport {
 
         assertEquals("Invalid queue name", "foo", hzlqEndpoint.getConfiguration().getQueueName());
         assertEquals("Value of concurrent consumers is invalid", 4, hzlqEndpoint.getConfiguration().getConcurrentConsumers());
-        assertEquals("Default value of pool interval is invalid", 1000, hzlqEndpoint.getConfiguration().getPollInterval());
+        assertEquals("Default value of pool timeout is invalid", 1000, hzlqEndpoint.getConfiguration().getPollTimeout());
     }
 
     @Test
     public void createEndpointWithPoolIntevalParam() throws Exception {
-        HazelcastSedaEndpoint hzlqEndpoint = (HazelcastSedaEndpoint) context.getEndpoint("hazelcast:seda:foo?pollInterval=4000");
+        HazelcastSedaEndpoint hzlqEndpoint = (HazelcastSedaEndpoint) context.getEndpoint("hazelcast:seda:foo?pollTimeout=4000");
 
         assertEquals("Invalid queue name", "foo", hzlqEndpoint.getConfiguration().getQueueName());
         assertEquals("Default value of concurrent consumers is invalid", 1, hzlqEndpoint.getConfiguration().getConcurrentConsumers());
-        assertEquals("Invalid pool interval", 4000, hzlqEndpoint.getConfiguration().getPollInterval());
+        assertEquals("Invalid pool timeout", 4000, hzlqEndpoint.getConfiguration().getPollTimeout());
     }
 
 }


Mime
View raw message