You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2014/04/17 16:51:02 UTC

[1/4] git commit: CXF-5700 Avoid to throw IllegalStateException in NettyHttpServletRequest

Repository: cxf
Updated Branches:
  refs/heads/master 6d2723015 -> d512d5273


CXF-5700 Avoid to throw IllegalStateException in NettyHttpServletRequest


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

Branch: refs/heads/master
Commit: d512d5273b747e970448730bcb10b867bc3abdaa
Parents: e2b5264
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Apr 17 22:50:27 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Apr 17 22:50:46 2014 +0800

----------------------------------------------------------------------
 .../server/servlet/NettyHttpServletRequest.java      | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d512d527/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java
index ece8e94..05ccc77 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java
@@ -416,20 +416,20 @@ public class NettyHttpServletRequest implements HttpServletRequest {
 
     @Override
     public String getAuthType() {
-        throw new IllegalStateException(
-                "Method 'getAuthType' not yet implemented!");
+        // CXF Calls this method to cache the Request informaiton
+        return null;
     }
 
     @Override
     public String getPathTranslated() {
-        throw new IllegalStateException(
-                "Method 'getPathTranslated' not yet implemented!");
+        // CXF Calls this method to cache the Request informaiton
+        return null;
     }
 
     @Override
     public String getRemoteUser() {
-        throw new IllegalStateException(
-                "Method 'getRemoteUser' not yet implemented!");
+        // CXF Calls this method to cache the Request informaiton
+        return null;
     }
 
     @Override
@@ -452,8 +452,7 @@ public class NettyHttpServletRequest implements HttpServletRequest {
 
     @Override
     public boolean isRequestedSessionIdValid() {
-        throw new IllegalStateException(
-                "Method 'isRequestedSessionIdValid' not yet implemented!");
+        return false;
     }
 
     @Override


[4/4] git commit: Updated the wsdl_first example to add option to use netty transport

Posted by ni...@apache.org.
Updated the wsdl_first example to add option to use netty transport


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

Branch: refs/heads/master
Commit: 7197b1003a72a0fd8c3b586df236304c3a40416f
Parents: 6d27230
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Apr 17 16:36:07 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Apr 17 22:50:46 2014 +0800

----------------------------------------------------------------------
 .../main/release/samples/wsdl_first/README.txt  |  5 ++
 .../src/main/release/samples/wsdl_first/pom.xml | 63 ++++++++++++++++++++
 2 files changed, 68 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7197b100/distribution/src/main/release/samples/wsdl_first/README.txt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/wsdl_first/README.txt b/distribution/src/main/release/samples/wsdl_first/README.txt
index 5df8a51..4f2ff95 100644
--- a/distribution/src/main/release/samples/wsdl_first/README.txt
+++ b/distribution/src/main/release/samples/wsdl_first/README.txt
@@ -85,6 +85,11 @@ Using either UNIX or Windows:
 There is no special Maven profile for the Spring client and server but you can
 easily set it up yourself.
 
+If you want to run the client and server with netty transport, you can use below command to  
+start up the server and client:
+  mvn -Pserver-netty (from one command line window -- only if using embedded Netty transport)
+  mvn -Pclient-netty (from one command line window -- only if using embedded Netty transport)
+
 If you're using Tomcat (embedded or standalone) for the web service provider:
 ----------------------------------------------------
 1.) Update the soap:address value in the resources/CustomerService.wsdl value,

http://git-wip-us.apache.org/repos/asf/cxf/blob/7197b100/distribution/src/main/release/samples/wsdl_first/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/wsdl_first/pom.xml b/distribution/src/main/release/samples/wsdl_first/pom.xml
index e52fc25..bfcdea1 100644
--- a/distribution/src/main/release/samples/wsdl_first/pom.xml
+++ b/distribution/src/main/release/samples/wsdl_first/pom.xml
@@ -134,6 +134,36 @@
             </dependencies>
         </profile>
         <profile>
+            <id>server-netty</id>
+            <build>
+                <defaultGoal>test</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>com.example.customerservice.server.CustomerServiceServer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.cxf</groupId>
+                    <artifactId>cxf-rt-transports-http-netty-server</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+            </dependencies>
+        </profile>
+        <profile>
             <id>client</id>
             <build>
                 <defaultGoal>test</defaultGoal>
@@ -159,6 +189,39 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>client-netty</id>
+            <build>
+                <defaultGoal>test</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>com.example.customerservice.client.CustomerServiceClient</mainClass>
+                                    <arguments>
+                                        <argument>src/main/resources/CustomerService.wsdl</argument>
+                                    </arguments>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.cxf</groupId>
+                    <artifactId>cxf-rt-transports-http-netty-client</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+            </dependencies>
+        </profile>
     </profiles>
     <dependencies>
         <dependency>


[3/4] git commit: CXF-5699 IdleStateHandler should not be shared across the channels

Posted by ni...@apache.org.
CXF-5699 IdleStateHandler should not be shared across the channels


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

Branch: refs/heads/master
Commit: e2b526476defbb109e71cd12a72dd78b8c0d4c66
Parents: 19a66ba
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Apr 17 22:36:52 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Apr 17 22:50:46 2014 +0800

----------------------------------------------------------------------
 .../http/netty/server/NettyHttpServerEngine.java       |  8 ++------
 .../netty/server/NettyHttpServletPipelineFactory.java  | 13 +++++++------
 2 files changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e2b52647/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
index ee77148..8434060 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
@@ -40,7 +40,6 @@ import io.netty.channel.ChannelOption;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.channel.socket.nio.NioServerSocketChannel;
-import io.netty.handler.timeout.IdleStateHandler;
 
 
 public class NettyHttpServerEngine implements ServerEngine {
@@ -151,17 +150,14 @@ public class NettyHttpServerEngine implements ServerEngine {
         bootstrap.group(bossGroup, workerGroup)
             .channel(NioServerSocketChannel.class)
             .option(ChannelOption.SO_REUSEADDR, true);
-                
-        // Set up the idle handler
-        IdleStateHandler idleStateHandler = 
-            new IdleStateHandler(getReadIdleTime(), getWriteIdleTime(), 0);
+
         // Set up the event pipeline factory.
         servletPipeline = 
             new NettyHttpServletPipelineFactory(
                  tlsServerParameters, sessionSupport, 
                  threadingParameters.getThreadPoolSize(),
                  maxChunkContentSize,
-                 handlerMap, idleStateHandler);
+                 handlerMap, this);
         // Start the servletPipeline's timer
         servletPipeline.start();
         bootstrap.childHandler(servletPipeline);

http://git-wip-us.apache.org/repos/asf/cxf/blob/e2b52647/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
index 7d9be18..600b47c 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
@@ -35,7 +35,6 @@ import org.apache.cxf.transport.http.netty.server.session.HttpSessionStore;
 import org.apache.cxf.transport.https.SSLUtils;
 
 import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelInitializer;
 import io.netty.channel.ChannelPipeline;
 import io.netty.channel.group.ChannelGroup;
@@ -58,8 +57,6 @@ public class NettyHttpServletPipelineFactory extends ChannelInitializer<Channel>
     private final ChannelGroup allChannels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);;
 
     private final HttpSessionWatchdog watchdog;
-
-    private final ChannelHandler idleStateHandler;
     
     private final TLSServerParameters tlsServerParameters;
     
@@ -71,16 +68,18 @@ public class NettyHttpServletPipelineFactory extends ChannelInitializer<Channel>
     
     private final EventExecutorGroup applicationExecutor;
 
+    private final NettyHttpServerEngine nettyHttpServerEngine;
+
     public NettyHttpServletPipelineFactory(TLSServerParameters tlsServerParameters, 
                                            boolean supportSession, int threadPoolSize, int maxChunkContentSize,
                                            Map<String, NettyHttpContextHandler> handlerMap,
-                                           IdleStateHandler idleStateHandler) {
+                                           NettyHttpServerEngine engine) {
         this.supportSession = supportSession;
-        this.idleStateHandler = idleStateHandler;
         this.watchdog = new HttpSessionWatchdog();
         this.handlerMap = handlerMap;
         this.tlsServerParameters = tlsServerParameters;
         this.maxChunkContentSize = maxChunkContentSize;
+        this.nettyHttpServerEngine = engine;
         //TODO need to configure the thread size of EventExecutorGroup
         applicationExecutor = new DefaultEventExecutorGroup(16);
     }
@@ -151,7 +150,9 @@ public class NettyHttpServletPipelineFactory extends ChannelInitializer<Channel>
         // Remove the following line if you don't want automatic content
         // compression.
         pipeline.addLast("deflater", new HttpContentCompressor());
-        pipeline.addLast("idle", this.idleStateHandler);
+        // Set up the idle handler
+        pipeline.addLast("idle", new IdleStateHandler(nettyHttpServerEngine.getReadIdleTime(),
+                nettyHttpServerEngine.getWriteIdleTime(), 0));
 
         return pipeline;
     }


[2/4] git commit: Upgrade netty4 to 4.0.18.Final

Posted by ni...@apache.org.
Upgrade netty4 to 4.0.18.Final


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

Branch: refs/heads/master
Commit: 19a66ba7cdadc06cad4bbb4b5b2d61d8b19e279b
Parents: 7197b10
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Apr 17 21:55:02 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Apr 17 22:50:46 2014 +0800

----------------------------------------------------------------------
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/19a66ba7/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 2a3b7a5..f980366 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -125,7 +125,7 @@
         <cxf.maven.core.version>2.2.1</cxf.maven.core.version>
         <cxf.msv.version>2011.1</cxf.msv.version>
         <cxf.neethi.version>3.0.3</cxf.neethi.version>
-        <cxf.netty.version>4.0.7.Final</cxf.netty.version>
+        <cxf.netty.version>4.0.18.Final</cxf.netty.version>
         <cxf.netty3.version>3.8.0.Final</cxf.netty3.version>
         <cxf.netty.version.range>[4,5)</cxf.netty.version.range>
         <cxf.oauth.bundle.version>20100527_1</cxf.oauth.bundle.version>