camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject git commit: CAMEL-7141 fixed the Custom HeaderFilterStrategy issue in camel-netty-http with thanks to Joe
Date Sat, 18 Jan 2014 07:57:26 GMT
Updated Branches:
  refs/heads/master edf19d530 -> 6695496ac


CAMEL-7141 fixed the Custom HeaderFilterStrategy issue in camel-netty-http with thanks to
Joe


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

Branch: refs/heads/master
Commit: 6695496acb64f1b5762ec094deeee448002ebc1f
Parents: edf19d5
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Sat Jan 18 15:52:44 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Sat Jan 18 15:56:34 2014 +0800

----------------------------------------------------------------------
 .../component/netty/http/NettyHttpComponent.java | 19 +++++++++++++++----
 .../component/netty/http/NettyHttpEndpoint.java  |  3 +++
 2 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6695496a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
index 5f617d7..0e4ccae 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
@@ -49,10 +49,6 @@ public class NettyHttpComponent extends NettyComponent implements HeaderFilterSt
     private NettyHttpSecurityConfiguration securityConfiguration;
 
     public NettyHttpComponent() {
-        // use the http configuration and filter strategy
-        setConfiguration(new NettyHttpConfiguration());
-        setHeaderFilterStrategy(new NettyHttpHeaderFilterStrategy());
-        setNettyHttpBinding(new DefaultNettyHttpBinding(getHeaderFilterStrategy()));
     }
 
     @Override
@@ -146,6 +142,9 @@ public class NettyHttpComponent extends NettyComponent implements HeaderFilterSt
     }
 
     public NettyHttpBinding getNettyHttpBinding() {
+        if (nettyHttpBinding == null) {
+            nettyHttpBinding = new DefaultNettyHttpBinding(getHeaderFilterStrategy());
+        }
         return nettyHttpBinding;
     }
 
@@ -154,6 +153,9 @@ public class NettyHttpComponent extends NettyComponent implements HeaderFilterSt
     }
 
     public HeaderFilterStrategy getHeaderFilterStrategy() {
+        if (headerFilterStrategy == null) {
+            headerFilterStrategy = new NettyHttpHeaderFilterStrategy();
+        }
         return headerFilterStrategy;
     }
 
@@ -190,6 +192,15 @@ public class NettyHttpComponent extends NettyComponent implements HeaderFilterSt
         }
         return answer;
     }
+    
+    @Override
+    protected void doStart() throws Exception {
+        if (getConfiguration() == null) {
+            setConfiguration(new NettyHttpConfiguration());
+        }
+      
+        super.doStart();
+    }
 
     @Override
     protected void doStop() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/6695496a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
index 27775c5..7d68050 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
@@ -137,6 +137,9 @@ public class NettyHttpEndpoint extends NettyEndpoint implements HeaderFilterStra
 
     public void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy) {
         this.headerFilterStrategy = headerFilterStrategy;
+        if (getNettyHttpBinding() != null) {
+            getNettyHttpBinding().setHeaderFilterStrategy(headerFilterStrategy);
+        }
     }
 
     public boolean isTraceEnabled() {


Mime
View raw message