camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/3] git commit: CAMEL-7848 Disable the AllowDefaultCodec option in camel-netty4-http
Date Mon, 29 Sep 2014 14:11:33 GMT
CAMEL-7848 Disable the AllowDefaultCodec option in camel-netty4-http


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

Branch: refs/heads/camel-2.14.x
Commit: 9c10014696b697848bd78ead9bf6e9da155d4ca8
Parents: df45ee4
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Mon Sep 29 09:03:47 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Mon Sep 29 22:10:36 2014 +0800

----------------------------------------------------------------------
 .../component/netty4/http/NettyHttpConfiguration.java     | 10 +++++++++-
 .../apache/camel/component/netty4/NettyConfiguration.java |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9c100146/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
index da4ba9d..2857912 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
@@ -20,7 +20,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import io.netty.channel.ChannelHandler;
-
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.component.netty4.NettyConfiguration;
 
@@ -162,5 +161,14 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     public void setChunkedMaxContentLength(int chunkedMaxContentLength) {
         this.chunkedMaxContentLength = chunkedMaxContentLength;
     }
+    
+    // Don't support allowDefaultCodec
+    public boolean isAllowDefaultCodec() {
+        return false;
+    }
+    
+    public void setAllowDefaultCodec(boolean allowDefaultCodec) {
+        throw new UnsupportedOperationException("You cannot setAllowDefaultCodec here.");
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/9c100146/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
index 472e50f..cf2f9d2 100644
--- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
+++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java
@@ -187,7 +187,7 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration
implem
 
         // add default encoders and decoders
         if (encoders.isEmpty() && decoders.isEmpty()) {
-            if (allowDefaultCodec) {
+            if (isAllowDefaultCodec()) {
                 if ("udp".equalsIgnoreCase(protocol)) {
                     encoders.add(ChannelHandlerFactories.newDatagramPacketEncoder());
                 }


Mime
View raw message