You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/08/08 06:19:43 UTC
[camel] branch master updated: CAMEL-13836: camel-util: move
SedaConstants to camel-seda (#3088)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 2e64f40 CAMEL-13836: camel-util: move SedaConstants to camel-seda (#3088)
2e64f40 is described below
commit 2e64f40dbb2cfdc77af0aafe1780fe49570862b2
Author: Luca Burgazzoli <lb...@users.noreply.github.com>
AuthorDate: Thu Aug 8 08:19:37 2019 +0200
CAMEL-13836: camel-util: move SedaConstants to camel-seda (#3088)
---
.../org/apache/camel/component/seda/SedaComponent.java | 15 +++++++--------
.../org/apache/camel/component/seda}/SedaConstants.java | 4 ++--
.../org/apache/camel/component/seda/SedaEndpoint.java | 5 ++---
.../component/seda/SameSedaQueueSizeAndNoSizeTest.java | 5 ++---
.../apache/camel/component/seda/SedaConfigureTest.java | 3 +--
.../apache/camel/component/seda/SedaQueueFactoryTest.java | 1 -
.../camel/component/vm/SameVmQueueSizeAndNoSizeTest.java | 4 ++--
7 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaComponent.java b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaComponent.java
index ac50883..5c78ddc 100644
--- a/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaComponent.java
+++ b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaComponent.java
@@ -25,7 +25,6 @@ import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.spi.Metadata;
import org.apache.camel.support.DefaultComponent;
-import org.apache.camel.util.SedaConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,7 +58,7 @@ public class SedaComponent extends DefaultComponent {
public void setQueueSize(int size) {
queueSize = size;
}
-
+
public int getQueueSize() {
return queueSize;
}
@@ -70,7 +69,7 @@ public class SedaComponent extends DefaultComponent {
public void setConcurrentConsumers(int size) {
concurrentConsumers = size;
}
-
+
public int getConcurrentConsumers() {
return concurrentConsumers;
}
@@ -98,12 +97,12 @@ public class SedaComponent extends DefaultComponent {
public void setDefaultBlockWhenFull(boolean defaultBlockWhenFull) {
this.defaultBlockWhenFull = defaultBlockWhenFull;
}
-
-
+
+
public long getDefaultOfferTimeout() {
return defaultOfferTimeout;
}
-
+
/**
* Whether a thread that sends messages to a full SEDA queue will block until the queue's capacity is no longer exhausted.
* By default, an exception will be thrown stating that the queue is full.
@@ -204,7 +203,7 @@ public class SedaComponent extends DefaultComponent {
boolean blockWhenFull = getAndRemoveParameter(parameters, "blockWhenFull", Boolean.class, defaultBlockWhenFull);
// if offerTimeout is set on endpoint, defaultOfferTimeout is ignored.
long offerTimeout = getAndRemoveParameter(parameters, "offerTimeout", long.class, defaultOfferTimeout);
-
+
answer.setOfferTimeout(offerTimeout);
answer.setBlockWhenFull(blockWhenFull);
answer.configureProperties(parameters);
@@ -237,7 +236,7 @@ public class SedaComponent extends DefaultComponent {
/**
* On shutting down the endpoint
- *
+ *
* @param endpoint the endpoint
*/
void onShutdownEndpoint(SedaEndpoint endpoint) {
diff --git a/core/camel-util/src/main/java/org/apache/camel/util/SedaConstants.java b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaConstants.java
similarity index 96%
rename from core/camel-util/src/main/java/org/apache/camel/util/SedaConstants.java
rename to components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaConstants.java
index 0d804ec..f0f3dcc 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/SedaConstants.java
+++ b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaConstants.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.util;
+package org.apache.camel.component.seda;
public final class SedaConstants {
-
+
public static final int MAX_CONCURRENT_CONSUMERS = 500;
public static final int CONCURRENT_CONSUMERS = 1;
public static final int QUEUE_SIZE = 1000;
diff --git a/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
index 77a75bf..68ef095 100644
--- a/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
+++ b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
@@ -45,7 +45,6 @@ import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
import org.apache.camel.support.DefaultEndpoint;
import org.apache.camel.support.service.ServiceHelper;
-import org.apache.camel.util.SedaConstants;
import org.apache.camel.util.URISupport;
/**
@@ -336,12 +335,12 @@ public class SedaEndpoint extends DefaultEndpoint implements AsyncEndpoint, Brow
public void setTimeout(long timeout) {
this.timeout = timeout;
}
-
+
@ManagedAttribute
public long getOfferTimeout() {
return offerTimeout;
}
-
+
/**
* offerTimeout (in milliseconds) can be added to the block case when queue is full.
* You can disable timeout by using 0 or a negative value.
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SameSedaQueueSizeAndNoSizeTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SameSedaQueueSizeAndNoSizeTest.java
index 210f3f6..e805b22 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SameSedaQueueSizeAndNoSizeTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SameSedaQueueSizeAndNoSizeTest.java
@@ -20,15 +20,14 @@ import org.apache.camel.CamelExecutionException;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.ResolveEndpointFailedException;
import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.util.SedaConstants;
import org.junit.Test;
/**
*
*/
public class SameSedaQueueSizeAndNoSizeTest extends ContextTestSupport {
-
-
+
+
@Test
public void testSameQueue() throws Exception {
for (int i = 0; i < 100; i++) {
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaConfigureTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaConfigureTest.java
index 0d66718..e181e73 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaConfigureTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaConfigureTest.java
@@ -21,11 +21,10 @@ import java.util.concurrent.LinkedBlockingQueue;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
-import org.apache.camel.util.SedaConstants;
import org.junit.Test;
public class SedaConfigureTest extends ContextTestSupport {
-
+
@SuppressWarnings("unchecked")
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaQueueFactoryTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaQueueFactoryTest.java
index 3d896ed..47f2cbb 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaQueueFactoryTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaQueueFactoryTest.java
@@ -23,7 +23,6 @@ import java.util.concurrent.LinkedBlockingQueue;
import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
-import org.apache.camel.util.SedaConstants;
import org.junit.Test;
/**
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/vm/SameVmQueueSizeAndNoSizeTest.java b/core/camel-core/src/test/java/org/apache/camel/component/vm/SameVmQueueSizeAndNoSizeTest.java
index b90bb0c..449d4b0 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/vm/SameVmQueueSizeAndNoSizeTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/vm/SameVmQueueSizeAndNoSizeTest.java
@@ -20,14 +20,14 @@ import org.apache.camel.CamelExecutionException;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.ResolveEndpointFailedException;
import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.util.SedaConstants;
+import org.apache.camel.component.seda.SedaConstants;
import org.junit.Test;
/**
*
*/
public class SameVmQueueSizeAndNoSizeTest extends ContextTestSupport {
-
+
@Test
public void testSameQueue() throws Exception {