cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1497278 - 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/spring/ main/resources/schemas/configuration/ test/java/org/apach...
Date Thu, 27 Jun 2013 10:02:33 GMT
Author: ningjiang
Date: Thu Jun 27 10:02:33 2013
New Revision: 1497278

URL: http://svn.apache.org/r1497278
Log:
CXF-5042 add thread pool configuration support

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/NettyHttpServerEngineFactory.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/spring/NettyHttpServerEngineBeanDefinitionParser.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineFactoryBeanDefinitionParser.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.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
    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

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=1497278&r1=1497277&r2=1497278&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
Thu Jun 27 10:02:33 2013
@@ -69,6 +69,8 @@ public class NettyHttpServerEngine imple
      */
     private TLSServerParameters tlsServerParameters;
     
+    private ThreadingParameters threadingParameters = new ThreadingParameters(); 
+    
     private int readIdleTime = 60;
     
     private int writeIdleTime = 30;
@@ -118,6 +120,14 @@ public class NettyHttpServerEngine imple
     public TLSServerParameters getTlsServerParameters() {
         return tlsServerParameters;
     }
+    
+    public void setThreadingParameters(ThreadingParameters params) {
+        threadingParameters = params;
+    }
+    
+    public ThreadingParameters getThreadingParameters() {
+        return threadingParameters;
+    }
       
     protected Channel startServer() {
         // TODO Configure the server.
@@ -130,7 +140,9 @@ public class NettyHttpServerEngine imple
         // Set up the event pipeline factory.
         servletPipeline = 
             new NettyHttpServletPipelineFactory(
-                 tlsServerParameters, sessionSupport, port, handlerMap, idleStateHandler);
+                 tlsServerParameters, sessionSupport, 
+                 threadingParameters.getThreadPoolSize(), 
+                 handlerMap, idleStateHandler);
         // Start the servletPipeline's timer
         servletPipeline.start();
         bootstrap.setPipelineFactory(servletPipeline);

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngineFactory.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/NettyHttpServerEngineFactory.java?rev=1497278&r1=1497277&r2=1497278&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngineFactory.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngineFactory.java
Thu Jun 27 10:02:33 2013
@@ -47,6 +47,13 @@ public class NettyHttpServerEngineFactor
 
     private BusLifeCycleManager lifeCycleManager;
     
+    /**
+     * This map holds the threading parameters that are to be applied
+     * to new Engines when bound to the reference id.
+     */
+    private Map<String, ThreadingParameters> threadingParametersMap =
+        new TreeMap<String, ThreadingParameters>();
+    
     private Map<String, TLSServerParameters> tlsServerParametersMap = 
         new TreeMap<String, TLSServerParameters>();
 
@@ -58,9 +65,12 @@ public class NettyHttpServerEngineFactor
         setBus(b);
     }
     
-    public NettyHttpServerEngineFactory(Bus b, Map<String, TLSServerParameters> tls)
{
+    public NettyHttpServerEngineFactory(Bus b, 
+                                        Map<String, TLSServerParameters> tls, 
+                                        Map<String, ThreadingParameters> threads) {
         setBus(b);
         tlsServerParametersMap = tls;
+        threadingParametersMap = threads;
     }
 
     public Bus getBus() {
@@ -93,11 +103,16 @@ public class NettyHttpServerEngineFactor
         this.tlsServerParametersMap = tlsParametersMap;
     }
     
+    public Map<String, ThreadingParameters> getThreadingParametersMap() {
+        return threadingParametersMap;
+    }
+    
+    public void setThreadingParametersMap(Map<String, ThreadingParameters> parameterMap)
{
+        this.threadingParametersMap = parameterMap;
+    }
+    
     public void setEnginesList(List<NettyHttpServerEngine> enginesList) {
         for (NettyHttpServerEngine engine : enginesList) {
-            /*if (engine.getPort() == FALLBACK_THREADING_PARAMS_KEY) {
-                fallbackThreadingParameters = engine.getThreadingParameters();
-            }*/
             portMap.putIfAbsent(engine.getPort(), engine);
         }    
     }

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=1497278&r1=1497277&r2=1497278&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
Thu Jun 27 10:02:33 2013
@@ -75,7 +75,9 @@ public class NettyHttpServletPipelineFac
         this.watchdog = new HttpSessionWatchdog();
         this.handlerMap = handlerMap;
         this.tlsServerParameters = tlsServerParameters;
-        this.executionHandler = new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(200,
2048576, 204857600));
+        // TODO need to check the if we need pass other setting
+        this.executionHandler = 
+            new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(threadPoolSize,
2048576, 204857600));
     }
 
 

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=1497278&r1=1497277&r2=1497278&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
Thu Jun 27 10:02:33 2013
@@ -47,7 +47,10 @@ import org.apache.cxf.configuration.spri
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.transport.http.netty.server.NettyHttpServerEngine;
 import org.apache.cxf.transport.http.netty.server.NettyHttpServerEngineFactory;
+import org.apache.cxf.transport.http.netty.server.ThreadingParameters;
 import org.apache.cxf.transports.http_netty_server.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_netty_server.configuration.ThreadingParametersIdentifiedType;
+import org.apache.cxf.transports.http_netty_server.configuration.ThreadingParametersType;
 
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.InitializingBean;
@@ -71,20 +74,15 @@ public class NettyHttpServerEngineBeanDe
         if (hostStr != null && !"".equals(hostStr.trim())) {
             bean.addPropertyValue("host", hostStr);
         }
-
-        String continuationsStr = element.getAttribute("continuationsEnabled");
-        if (continuationsStr != null && continuationsStr.length() > 0) {
-            bean.addPropertyValue("continuationsEnabled", continuationsStr);
-        }
         
-        String maxIdleTimeStr = element.getAttribute("maxIdleTime");
-        if (maxIdleTimeStr != null && !"".equals(maxIdleTimeStr.trim())) {
-            bean.addPropertyValue("maxIdleTime", maxIdleTimeStr);
+        String readIdleTimeStr = element.getAttribute("readIdleTime");
+        if (readIdleTimeStr != null && !"".equals(readIdleTimeStr.trim())) {
+            bean.addPropertyValue("readIdleTime", readIdleTimeStr);
         }
         
-        String sendServerVersionStr = element.getAttribute("sendServerVersion");
-        if (sendServerVersionStr != null && sendServerVersionStr.length() > 0)
{
-            bean.addPropertyValue("sendServerVersion", sendServerVersionStr);
+        String writeIdleTimeStr = element.getAttribute("writeIdleTime");
+        if (writeIdleTimeStr != null && !"".equals(writeIdleTimeStr.trim())) {
+            bean.addPropertyValue("writeIdleTime", writeIdleTimeStr);
         }
         
         ValueHolder busValue = ctx.getContainingBeanDefinition()
@@ -103,6 +101,21 @@ public class NettyHttpServerEngineBeanDe
                                                     TLSServerParametersIdentifiedType.class,
                                                     NettyHttpServerEngineBeanDefinitionParser.class,
                                                     "createTLSServerParametersConfigRef");
+                } else if ("threadingParameters".equals(name)) {
+                    mapElementToJaxbPropertyFactory(elem,
+                                                    bean,
+                                                    "threadingParameters",
+                                                    ThreadingParametersType.class,
+                                                    NettyHttpServerEngineBeanDefinitionParser.class,
+                                                    "createThreadingParameters");
+                } else if ("threadingParametersRef".equals(name)) {
+                    mapElementToJaxbPropertyFactory(elem,
+                                                    bean,
+                                                    "threadingParametersRef",
+                                                    ThreadingParametersIdentifiedType.class,
+                                                    NettyHttpServerEngineBeanDefinitionParser.class,
+                                                    "createThreadingParametersRef"
+                                                    );
                 } else if ("sessionSupport".equals(name) || "reuseAddress".equals(name))
{
                     String text = elem.getTextContent();                        
                     bean.addPropertyValue(name, text);
@@ -253,6 +266,9 @@ public class NettyHttpServerEngineBeanDe
             if (tlsRef != null) {
                 setTlsServerParameters(factory.getTlsServerParametersMap().get(tlsRef));
             }
+            if (threadingRef != null) {
+                setThreadingParameters(factory.getThreadingParametersMap().get(threadingRef));
+            }
             super.finalizeConfig();
         }
 
@@ -266,8 +282,8 @@ public class NettyHttpServerEngineBeanDe
                                                                             JAXBContext context)

         throws GeneralSecurityException, IOException {
         
-        TLSServerParametersType parametersType = unmarshalFactoryString(s, context,
-                                                                        TLSServerParametersType.class);
+        TLSServerParametersType parametersType = 
+            unmarshalFactoryString(s, context, TLSServerParametersType.class);
         
         return new TLSServerParametersConfig(parametersType);
     }
@@ -280,6 +296,27 @@ public class NettyHttpServerEngineBeanDe
             = unmarshalFactoryString(s, context, TLSServerParametersIdentifiedType.class);
         
         return parameterTypeRef.getId(); 
-    } 
+    }
+    
+    private static ThreadingParameters toThreadingParameters(ThreadingParametersType paramtype)
{
+        ThreadingParameters params = new ThreadingParameters();
+        if (paramtype.getThreadPoolSize() != null) {
+            params.setThreadPoolSize(paramtype.getThreadPoolSize());
+        }
+
+        return params;
+    }
+    
+    public static ThreadingParameters createThreadingParameters(String s, JAXBContext context)
{
+        ThreadingParametersType parametersType = 
+            unmarshalFactoryString(s, context, ThreadingParametersType.class);
+        return toThreadingParameters(parametersType);
+    }
+
+    public static String createThreadingParametersRef(String s, JAXBContext context) {
+        ThreadingParametersIdentifiedType parametersType = 
+            unmarshalFactoryString(s, context, ThreadingParametersIdentifiedType.class);
+        return parametersType.getId();
+    }
    
 }

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineFactoryBeanDefinitionParser.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/NettyHttpServerEngineFactoryBeanDefinitionParser.java?rev=1497278&r1=1497277&r2=1497278&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettyHttpServerEngineFactoryBeanDefinitionParser.java
Thu Jun 27 10:02:33 2013
@@ -34,7 +34,9 @@ import org.apache.cxf.configuration.spri
 import org.apache.cxf.configuration.spring.BusWiringType;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.transport.http.netty.server.NettyHttpServerEngineFactory;
+import org.apache.cxf.transport.http.netty.server.ThreadingParameters;
 import org.apache.cxf.transports.http_netty_server.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_netty_server.configuration.ThreadingParametersIdentifiedType;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
@@ -86,6 +88,11 @@ public class NettyHttpServerEngineFactor
                                                         NettySpringTypesFactory.class,
                                                         "createTLSServerParametersMap"));
             
+            bean.addConstructorArgValue(mapElementToJaxbBean(element,
+                                                             ThreadingParametersIdentifiedType.class,
+                                                             NettySpringTypesFactory.class,
+                                                             "createThreadingParametersMap"));
+            
             // parser the engine list
             List<Object> list = 
                 getRequiredElementsList(element, ctx, new QName(HTTP_NETTY_SERVER_NS, "engine"),
bean);
@@ -138,8 +145,9 @@ public class NettyHttpServerEngineFactor
             super();
         }
         public SpringNettyHttpServerEngineFactory(Bus bus,
-                                                  Map<String, TLSServerParameters>
tls) {
-            super(bus, tls);
+                                                  Map<String, TLSServerParameters>
tls,
+                                                  Map<String, ThreadingParameters>
threads) {
+            super(bus, tls, threads);
         }   
         
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.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/NettySpringTypesFactory.java?rev=1497278&r1=1497277&r2=1497278&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java
Thu Jun 27 10:02:33 2013
@@ -38,7 +38,10 @@ import org.apache.cxf.common.injection.N
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.configuration.jsse.TLSServerParametersConfig;
 import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.transport.http.netty.server.ThreadingParameters;
 import org.apache.cxf.transports.http_netty_server.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_netty_server.configuration.ThreadingParametersIdentifiedType;
+import org.apache.cxf.transports.http_netty_server.configuration.ThreadingParametersType;
 
 
 @NoJSR250Annotations
@@ -46,6 +49,23 @@ public final class NettySpringTypesFacto
     public NettySpringTypesFactory() {
         
     }
+    
+    private static Map<String, ThreadingParameters> toThreadingParameters(
+        List<ThreadingParametersIdentifiedType> list) {
+        
+        Map<String, ThreadingParameters> map = new TreeMap<String, ThreadingParameters>();
+        for (ThreadingParametersIdentifiedType t : list) {
+            ThreadingParameters parameter = toThreadingParameters(t.getThreadingParameters());
+            map.put(t.getId(), parameter);
+        }
+        return map;
+    }
+
+    private static ThreadingParameters toThreadingParameters(ThreadingParametersType paramtype)
{
+        ThreadingParameters params = new ThreadingParameters();
+        params.setThreadPoolSize(paramtype.getThreadPoolSize());
+        return params;
+    }
         
     private static Map<String, TLSServerParameters> toTLSServerParamenters(
         List <TLSServerParametersIdentifiedType> list) {
@@ -80,6 +100,21 @@ public final class NettySpringTypesFacto
         return tlsServerParametersMap;
     }
     
+    public Map<String, ThreadingParameters> createThreadingParametersMap(String s,
+                                                                         JAXBContext ctx)

+        throws Exception {
+        Document doc = DOMUtils.readXml(new StringReader(s));
+        List <ThreadingParametersIdentifiedType> threadingParametersIdentifiedTypes
= 
+            NettySpringTypesFactory
+                .parseListElement(doc.getDocumentElement(), 
+                                  new QName(NettyHttpServerEngineFactoryBeanDefinitionParser.HTTP_NETTY_SERVER_NS,
+                                            "identifiedThreadingParameters"), 
+                                  ThreadingParametersIdentifiedType.class, ctx);
+        Map<String, ThreadingParameters> threadingParametersMap =
+            toThreadingParameters(threadingParametersIdentifiedTypes);
+        return threadingParametersMap;
+    }
+    
     @SuppressWarnings("unchecked")
     public static <V> List<V> parseListElement(Element parent, 
                                            QName name, 

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=1497278&r1=1497277&r2=1497278&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
Thu Jun 27 10:02:33 2013
@@ -40,6 +40,28 @@
     <xs:import namespace="http://cxf.apache.org/configuration/parameterized-types"
                schemaLocation="http://cxf.apache.org/schemas/configuration/parameterized-types.xsd"/>
     
+    <xs:complexType name="ThreadingParametersType">
+       <xs:attribute name="threadPoolSize" type="ptp:ParameterizedUShort">
+          <xs:annotation>
+             <xs:documentation>Specifies the number of threads available to the Netty
instance for processing requests.</xs:documentation>
+          </xs:annotation>
+       </xs:attribute>
+    </xs:complexType>
+    
+    <xs:complexType name="ThreadingParametersIdentifiedType">
+       <xs:sequence>
+         <xs:element name="threadingParameters" type="tns:ThreadingParametersType">
+            <xs:annotation>
+               <xs:documentation>Specifies the thread pool properties for the parameter
set.</xs:documentation>
+            </xs:annotation>
+         </xs:element>
+       </xs:sequence>
+         <xs:attribute name="id" type="xs:string">
+             <xs:annotation>
+                <xs:documentation>Specifies a unique identifier by which the property
set can be referred.</xs:documentation>
+             </xs:annotation>
+         </xs:attribute>
+    </xs:complexType>
     
     <xs:complexType name="TLSServerParametersIdentifiedType">
        <xs:sequence>
@@ -76,6 +98,20 @@
              </xs:annotation>
           </xs:element>
          </xs:choice>
+         <xs:choice minOccurs="0" maxOccurs="1">
+          <xs:element name="threadingParameters" 
+                      type="tns:ThreadingParametersType">
+             <xs:annotation>
+                <xs:documentation>Specifies an instance of the threading configuration
use for the Jetty engine.</xs:documentation>
+             </xs:annotation>
+          </xs:element>
+          <xs:element name="threadingParametersRef"
+                      type="tns:ParametersRefType">
+             <xs:annotation>
+                <xs:documentation>Specifies a reference to a reusable set of threading
parameters.</xs:documentation>
+             </xs:annotation>
+          </xs:element>
+         </xs:choice>  
          <xs:element name="sessionSupport" type="ptp:ParameterizedBoolean" minOccurs="0"/>
          <xs:element name="reuseAddress" type="ptp:ParameterizedBoolean" minOccurs="0"
/>          
        </xs:sequence>
@@ -118,6 +154,13 @@
                  <xs:documentation>Specifies a reusable set of properties for securing
an HTTP service provider.</xs:documentation>
               </xs:annotation>
            </xs:element>
+            <xs:element name="identifiedThreadingParameters"
+                       type="tns:ThreadingParametersIdentifiedType"
+                       minOccurs="0" maxOccurs="unbounded">
+              <xs:annotation>
+                 <xs:documentation>Specifies a reusable set of properties for controlling
a Jetty instance's thread pool.</xs:documentation>
+              </xs:annotation>
+           </xs:element>
            <xs:element name="engine" 
                        type="tns:NettyHttpServerEngineConfigType" 
                        minOccurs="0" maxOccurs="unbounded">

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=1497278&r1=1497277&r2=1497278&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
Thu Jun 27 10:02:33 2013
@@ -87,6 +87,7 @@ public class ApplicationContextTest exte
         ctx.close();
         ctx.destroy();
     }
+    
     @Test
     public void testContextWithProperties() throws Exception {
         String s4 = getClass()
@@ -114,9 +115,9 @@ public class ApplicationContextTest exte
         assertEquals("foobar", jd.getServer().getContentEncoding());   
         
         NettyHttpServerEngine engine = (NettyHttpServerEngine)jd.getEngine();
-        //assertEquals(111, engine.getThreadingParameters().getMinThreads());
-        //assertEquals(120, engine.getThreadingParameters().getMaxThreads());
+        assertEquals(120, engine.getThreadingParameters().getThreadPoolSize());
         
+       
         ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
         ConduitInitiator ci = cim.getConduitInitiator("http://cxf.apache.org/transports/http");
         HTTPConduit conduit = (HTTPConduit) ci.getConduit(info, bus);
@@ -131,8 +132,8 @@ public class ApplicationContextTest exte
                 getEndpointInfo("foo", "bar", "http://localhost:9001"), bus);
         
         engine = (NettyHttpServerEngine)jd2.getEngine();
-        //assertEquals(40000, engine.getMaxIdleTime());
-        //assertTrue("The engine should support session manager", engine.isSessionSupport());
+        assertEquals(40000, engine.getReadIdleTime());
+        assertTrue("The engine should support session manager", engine.isSessionSupport());
         
         NettyHttpDestination jd3 = 
             (NettyHttpDestination)factory.getDestination(

Modified: 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/java/org/apache/cxf/transport/http/netty/server/spring/bean.properties?rev=1497278&r1=1497277&r2=1497278&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/java/org/apache/cxf/transport/http/netty/server/spring/bean.properties
Thu Jun 27 10:02:33 2013
@@ -22,9 +22,6 @@ engine.port.nine.one=9001
 engine.port.nine.two=9002
 engine.port.nine.three=9003
 
-engine.port.zero.minThreads=21
-engine.port.zero.maxThreads=389
-engine.port.nine.one.minThreads=99
-engine.port.nine.one.maxThreads=777
+engine.port.zero.threadPoolSize=21
+engine.port.nine.one.threadPoolSize=99
 engine.port.nine.one.readIdle=40000
-engine.port.nine.one.sendServerVersion=false

Modified: 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/java/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml?rev=1497278&r1=1497277&r2=1497278&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/java/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml
Thu Jun 27 10:02:33 2013
@@ -68,7 +68,16 @@
         </hn:tlsServerParameters>
        </hn:identifiedTLSServerParameters>
        
+       <hn:identifiedThreadingParameters id="sampleThreading1">
+	      <hn:threadingParameters threadPoolSize="120"/>
+	   </hn:identifiedThreadingParameters>
+	   
+	   <hn:engine port="${engine.port.nine.zero}">
+	      <hn:threadingParametersRef id="sampleThreading1"/>	      
+	   </hn:engine>
+       
 	   <hn:engine port="$(engine.port.nine.one)" readIdleTime="$(engine.port.nine.one.readIdle)">
+	     <hn:threadingParameters threadPoolSize="$(engine.port.nine.one.threadPoolSize)"
/>	
          <hn:sessionSupport>true</hn:sessionSupport>
 	  </hn:engine> 
 	  

Modified: 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/java/org/apache/cxf/transport/http/netty/server/spring/beans.xml?rev=1497278&r1=1497277&r2=1497278&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/java/org/apache/cxf/transport/http/netty/server/spring/beans.xml
Thu Jun 27 10:02:33 2013
@@ -53,16 +53,20 @@
         </hn:tlsServerParameters>
        </hn:identifiedTLSServerParameters>
        
+       <hn:identifiedThreadingParameters id="sampleThreading1">
+	      <hn:threadingParameters threadPoolSize="120"/>
+	   </hn:identifiedThreadingParameters>
+       
 	   <hn:engine port="9000" readIdleTime="30000" writeIdleTime="90000">
-	      <!-- hn:threadingParametersRef id="sampleThreading1"/-->	      
+	      <hn:threadingParametersRef id="sampleThreading1"/>	      
 	   </hn:engine>
 	   
 	   <hn:engine port="0">
-	      <!-- hn:threadingParameters minThreads="21" maxThreads="389"/-->
+	      <hn:threadingParameters threadPoolSize="400"/>
 	   </hn:engine>
 	   
 	   <hn:engine port="9001" readIdleTime="40000">
-	       <!-- hn:threadingParameters minThreads="99" maxThreads="777"/-->	      
+	     <hn:threadingParameters threadPoolSize="99" />	      
 	     <hn:sessionSupport>true</hn:sessionSupport>
 	  </hn:engine> 
 	  



Mime
View raw message