You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/07/25 12:59:08 UTC
[1/2] camel git commit: CAMEL-10181: Camel-undertow:
UndertowHttpBinding should be initialized in the endpoint and not at
component level
Repository: camel
Updated Branches:
refs/heads/camel-2.17.x 6aa84254f -> 052807ad2
CAMEL-10181: Camel-undertow: UndertowHttpBinding should be initialized in the endpoint and not at component level
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6df702ce
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6df702ce
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6df702ce
Branch: refs/heads/camel-2.17.x
Commit: 6df702ce6074dcbe3d5452201241477b53e31169
Parents: 6aa8425
Author: Andrea Cosentino <an...@gmail.com>
Authored: Mon Jul 25 14:10:35 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Mon Jul 25 14:35:18 2016 +0200
----------------------------------------------------------------------
.../camel/component/undertow/UndertowComponent.java | 11 +++++++++--
.../camel/component/undertow/UndertowEndpoint.java | 8 ++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/6df702ce/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java
index 65771f2..a43979b 100644
--- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java
@@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory;
public class UndertowComponent extends UriEndpointComponent implements RestConsumerFactory, RestApiConsumerFactory {
private static final Logger LOG = LoggerFactory.getLogger(UndertowEndpoint.class);
- private UndertowHttpBinding undertowHttpBinding = new DefaultUndertowHttpBinding();
+ private UndertowHttpBinding undertowHttpBinding;
private final Map<Integer, UndertowRegistry> serversRegistry = new HashMap<Integer, UndertowRegistry>();
private SSLContextParameters sslContextParameters;
@@ -78,7 +78,14 @@ public class UndertowComponent extends UriEndpointComponent implements RestConsu
UndertowEndpoint endpoint = createEndpointInstance(endpointUri, this);
// set options from component
endpoint.setSslContextParameters(sslContextParameters);
- endpoint.setUndertowHttpBinding(undertowHttpBinding);
+ // Prefer endpoint configured over component configured
+ if (undertowHttpBinding == null) {
+ // fallback to component configured
+ undertowHttpBinding = getUndertowHttpBinding();
+ }
+ if (undertowHttpBinding != null) {
+ endpoint.setUndertowHttpBinding(undertowHttpBinding);
+ }
// set options from parameters
setProperties(endpoint, parameters);
if (options != null) {
http://git-wip-us.apache.org/repos/asf/camel/blob/6df702ce/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java
index 9111ecd..f71da15 100644
--- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java
@@ -60,7 +60,7 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr
@UriParam(label = "advanced")
private UndertowHttpBinding undertowHttpBinding;
@UriParam(label = "advanced")
- private HeaderFilterStrategy headerFilterStrategy;
+ private HeaderFilterStrategy headerFilterStrategy = new UndertowHeaderFilterStrategy();
@UriParam(label = "security")
private SSLContextParameters sslContextParameters;
@UriParam(label = "consumer")
@@ -178,7 +178,6 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr
*/
public void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy) {
this.headerFilterStrategy = headerFilterStrategy;
- undertowHttpBinding.setHeaderFilterStrategy(headerFilterStrategy);
}
public SSLContextParameters getSslContextParameters() {
@@ -217,6 +216,11 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr
}
public UndertowHttpBinding getUndertowHttpBinding() {
+ if (undertowHttpBinding == null) {
+ // create a new binding and use the options from this endpoint
+ undertowHttpBinding = new DefaultUndertowHttpBinding();
+ undertowHttpBinding.setHeaderFilterStrategy(getHeaderFilterStrategy());
+ }
return undertowHttpBinding;
}
[2/2] camel git commit: Fixed CS
Posted by ac...@apache.org.
Fixed CS
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/052807ad
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/052807ad
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/052807ad
Branch: refs/heads/camel-2.17.x
Commit: 052807ad26da72c4c5fb7fd6fbfa68aebcc5ae7e
Parents: 6df702c
Author: Andrea Cosentino <an...@gmail.com>
Authored: Mon Jul 25 14:15:11 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Mon Jul 25 14:36:48 2016 +0200
----------------------------------------------------------------------
.../org/apache/camel/component/undertow/UndertowComponent.java | 2 +-
.../org/apache/camel/component/undertow/UndertowEndpoint.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/052807ad/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java
index a43979b..2541fd0 100644
--- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java
@@ -81,7 +81,7 @@ public class UndertowComponent extends UriEndpointComponent implements RestConsu
// Prefer endpoint configured over component configured
if (undertowHttpBinding == null) {
// fallback to component configured
- undertowHttpBinding = getUndertowHttpBinding();
+ undertowHttpBinding = getUndertowHttpBinding();
}
if (undertowHttpBinding != null) {
endpoint.setUndertowHttpBinding(undertowHttpBinding);
http://git-wip-us.apache.org/repos/asf/camel/blob/052807ad/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java
index f71da15..5db8abf 100644
--- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java
@@ -218,8 +218,8 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr
public UndertowHttpBinding getUndertowHttpBinding() {
if (undertowHttpBinding == null) {
// create a new binding and use the options from this endpoint
- undertowHttpBinding = new DefaultUndertowHttpBinding();
- undertowHttpBinding.setHeaderFilterStrategy(getHeaderFilterStrategy());
+ undertowHttpBinding = new DefaultUndertowHttpBinding();
+ undertowHttpBinding.setHeaderFilterStrategy(getHeaderFilterStrategy());
}
return undertowHttpBinding;
}