cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1503143 - in /cxf/trunk/rt/transports/http-netty/netty-server/src: main/java/org/apache/cxf/transport/http/netty/server/ main/java/org/apache/cxf/transport/http/netty/server/blueprint/ main/java/org/apache/cxf/transport/http/netty/server/s...
Date Mon, 15 Jul 2013 09:03:07 GMT
Author: ningjiang
Date: Mon Jul 15 09:03:07 2013
New Revision: 1503143

URL: http://svn.apache.org/r1503143
Log:
CXF-5127 added the maxChunkContentSize option to netty-server

Added:
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/bean.properties
      - copied, changed from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/bean.properties
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml
      - copied, changed from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans.xml
      - copied, changed from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans.xml
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml
      - copied, changed from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/serverenginefactory.xml
      - copied, changed from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/serverenginefactory.xml
Removed:
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/bean.properties
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans.xml
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/serverenginefactory.xml
Modified:
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/NettyHttpServerEngineFactoryHolder.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineBeanDefinitionParser.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/resources/schemas/configuration/http-netty-server.xsd
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/ApplicationContextTest.java

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java?rev=1503143&r1=1503142&r2=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
Mon Jul 15 09:03:07 2013
@@ -75,6 +75,8 @@ public class NettyHttpServerEngine imple
     
     private int writeIdleTime = 30;
     
+    private int maxChunkContentSize = 1048576; 
+    
     private boolean sessionSupport;
     
     public NettyHttpServerEngine() {
@@ -141,7 +143,8 @@ public class NettyHttpServerEngine imple
         servletPipeline = 
             new NettyHttpServletPipelineFactory(
                  tlsServerParameters, sessionSupport, 
-                 threadingParameters.getThreadPoolSize(), 
+                 threadingParameters.getThreadPoolSize(),
+                 maxChunkContentSize,
                  handlerMap, idleStateHandler);
         // Start the servletPipeline's timer
         servletPipeline.start();
@@ -234,6 +237,14 @@ public class NettyHttpServerEngine imple
         this.sessionSupport = session;
     }
     
+    public int getMaxChunkContentSize() {
+        return maxChunkContentSize;
+    }
+
+    public void setMaxChunkContentSize(int maxChunkContentSize) {
+        this.maxChunkContentSize = maxChunkContentSize;
+    }
+    
     public int getPort() {
         return port;
     }

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java?rev=1503143&r1=1503142&r2=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
Mon Jul 15 09:03:07 2013
@@ -65,9 +65,11 @@ public class NettyHttpServletPipelineFac
     private final ExecutionHandler executionHandler;
 
     private final Map<String, NettyHttpContextHandler> handlerMap;
+    
+    private final int maxChunkContentSize;
 
     public NettyHttpServletPipelineFactory(TLSServerParameters tlsServerParameters, 
-                                           boolean supportSession, int threadPoolSize,
+                                           boolean supportSession, int threadPoolSize, int
maxChunkContentSize,
                                            Map<String, NettyHttpContextHandler> handlerMap,
                                            IdleStateHandler idleStateHandler) {
         this.supportSession = supportSession;
@@ -75,6 +77,7 @@ public class NettyHttpServletPipelineFac
         this.watchdog = new HttpSessionWatchdog();
         this.handlerMap = handlerMap;
         this.tlsServerParameters = tlsServerParameters;
+        this.maxChunkContentSize = maxChunkContentSize;
         // TODO need to check the if we need pass other setting
         this.executionHandler = 
             new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(threadPoolSize,
2048576, 204857600));
@@ -148,7 +151,7 @@ public class NettyHttpServletPipelineFac
         }
 
         pipeline.addLast("decoder", new HttpRequestDecoder());
-        pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
+        pipeline.addLast("aggregator", new HttpChunkAggregator(maxChunkContentSize));
         pipeline.addLast("encoder", new HttpResponseEncoder());
 
         // Remove the following line if you don't want automatic content

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/NettyHttpServerEngineFactoryHolder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/NettyHttpServerEngineFactoryHolder.java?rev=1503143&r1=1503142&r2=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/NettyHttpServerEngineFactoryHolder.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/NettyHttpServerEngineFactoryHolder.java
Mon Jul 15 09:03:07 2013
@@ -120,6 +120,9 @@ public class NettyHttpServerEngineFactor
                 if (engine.getWriteIdleTime() != null) {
                     eng.setWriteIdleTime(engine.getWriteIdleTime());
                 }
+                if (engine.getMaxChunkContentSize() != null) {
+                    eng.setMaxChunkContentSize(engine.getMaxChunkContentSize());
+                }
                 if (engine.getPort() != null) {
                     eng.setPort(engine.getPort());
                 }

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineBeanDefinitionParser.java?rev=1503143&r1=1503142&r2=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineBeanDefinitionParser.java
Mon Jul 15 09:03:07 2013
@@ -85,6 +85,12 @@ public class NettyHttpServerEngineBeanDe
             bean.addPropertyValue("writeIdleTime", writeIdleTimeStr);
         }
         
+        String maxChunkContentSizeStr = element.getAttribute("maxChunkContentSize");
+        if (maxChunkContentSizeStr != null && !"".equals(maxChunkContentSizeStr.trim()))
{
+            bean.addPropertyValue("maxChunkContentSize", maxChunkContentSizeStr);
+        }
+        
+        
         ValueHolder busValue = ctx.getContainingBeanDefinition()
             .getConstructorArgumentValues().getArgumentValue(0, Bus.class);
         bean.addPropertyValue("bus", busValue.getValue());

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/resources/schemas/configuration/http-netty-server.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/resources/schemas/configuration/http-netty-server.xsd?rev=1503143&r1=1503142&r2=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/resources/schemas/configuration/http-netty-server.xsd
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/resources/schemas/configuration/http-netty-server.xsd
Mon Jul 15 09:03:07 2013
@@ -143,6 +143,11 @@
                 <xs:documentation>Specifies the maximum write idle time for a Netty
connection. The timer is reset whenever there are any write actions on the underlying stream.</xs:documentation>

            </xs:annotation>
        </xs:attribute>
+       <xs:attribute name="maxChunkContentSize" type="ptp:ParameterizedInt">
+           <xs:annotation>  
+                <xs:documentation>Specifies the maximum aggregated content size for
a Netty connection. The default value is 10M.</xs:documentation> 
+           </xs:annotation>
+       </xs:attribute>
     </xs:complexType>
     
     <xs:complexType name="NettyHttpServerEngineFactoryConfigType">

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/ApplicationContextTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/ApplicationContextTest.java?rev=1503143&r1=1503142&r2=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/ApplicationContextTest.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/ApplicationContextTest.java
Mon Jul 15 09:03:07 2013
@@ -133,6 +133,7 @@ public class ApplicationContextTest exte
         
         engine = (NettyHttpServerEngine)jd2.getEngine();
         assertEquals(40000, engine.getReadIdleTime());
+        assertEquals(10000, engine.getMaxChunkContentSize());
         assertTrue("The engine should support session manager", engine.isSessionSupport());
         
         NettyHttpDestination jd3 = 

Copied: cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/bean.properties
(from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/bean.properties)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/bean.properties?p2=cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/bean.properties&p1=cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/bean.properties&r1=1502893&r2=1503143&rev=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/bean.properties
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/bean.properties
Mon Jul 15 09:03:07 2013
@@ -25,3 +25,4 @@ engine.port.nine.three=9003
 engine.port.zero.threadPoolSize=21
 engine.port.nine.one.threadPoolSize=99
 engine.port.nine.one.readIdle=40000
+engine.port.nine.one.maxChunkContentSize=10000

Copied: cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml
(from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml?p2=cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml&p1=cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml&r1=1502893&r2=1503143&rev=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml
Mon Jul 15 09:03:07 2013
@@ -76,7 +76,7 @@
 	      <hn:threadingParametersRef id="sampleThreading1"/>	      
 	   </hn:engine>
        
-	   <hn:engine port="$(engine.port.nine.one)" readIdleTime="$(engine.port.nine.one.readIdle)">
+	   <hn:engine port="$(engine.port.nine.one)" readIdleTime="$(engine.port.nine.one.readIdle)"
maxChunkContentSize="${engine.port.nine.one.maxChunkContentSize}">
 	     <hn:threadingParameters threadPoolSize="$(engine.port.nine.one.threadPoolSize)"
/>	
          <hn:sessionSupport>true</hn:sessionSupport>
 	  </hn:engine> 

Copied: cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans.xml
(from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans.xml?p2=cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans.xml&p1=cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans.xml&r1=1502893&r2=1503143&rev=1503143&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/beans.xml
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/beans.xml
Mon Jul 15 09:03:07 2013
@@ -65,7 +65,7 @@
 	      <hn:threadingParameters threadPoolSize="400"/>
 	   </hn:engine>
 	   
-	   <hn:engine port="9001" readIdleTime="40000">
+	   <hn:engine port="9001" readIdleTime="40000" maxChunkContentSize="10000">
 	     <hn:threadingParameters threadPoolSize="99" />	      
 	     <hn:sessionSupport>true</hn:sessionSupport>
 	  </hn:engine> 

Copied: cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml
(from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml?p2=cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml&p1=cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml&r1=1502893&r2=1503143&rev=1503143&view=diff
==============================================================================
    (empty)

Copied: cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/serverenginefactory.xml
(from r1502893, cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/serverenginefactory.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/serverenginefactory.xml?p2=cxf/trunk/rt/transports/http-netty/netty-server/src/test/resources/org/apache/cxf/transport/http/netty/server/spring/serverenginefactory.xml&p1=cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/spring/serverenginefactory.xml&r1=1502893&r2=1503143&rev=1503143&view=diff
==============================================================================
    (empty)



Mime
View raw message