Package org.apache.cxf.transport.http.netty.server

Examples of org.apache.cxf.transport.http.netty.server.NettyHttpServerEngine


        Destination d = factory.getDestination(info, bus);
        assertTrue(d instanceof NettyHttpDestination);
        NettyHttpDestination jd = (NettyHttpDestination) d;       
        assertEquals("foobar", jd.getServer().getContentEncoding());  
       
        NettyHttpServerEngine engine = (NettyHttpServerEngine)jd.getEngine();
        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);
        assertEquals(97, conduit.getClient().getConnectionTimeout());
       
        info.setName(new QName("urn:test:ns", "Bar"));
        conduit = (HTTPConduit) ci.getConduit(info, bus);
        assertEquals(79, conduit.getClient().getConnectionTimeout());

        NettyHttpDestination jd2 =
            (NettyHttpDestination)factory.getDestination(
                getEndpointInfo("foo", "bar", "http://localhost:9001"), bus);
       
        engine = (NettyHttpServerEngine)jd2.getEngine();
        assertEquals(40000, engine.getReadIdleTime());
        assertEquals(10000, engine.getMaxChunkContentSize());
        assertTrue("The engine should support session manager", engine.isSessionSupport());
       
        NettyHttpDestination jd3 =
            (NettyHttpDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "https://localhost:9002"), bus);
       
        engine = (NettyHttpServerEngine)jd3.getEngine();
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), true);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), true);
       
        NettyHttpDestination jd4 =
            (NettyHttpDestination)factory.getDestination(
                getEndpointInfo("sna", "foo2", "https://localhost:9003"), bus);
       
        engine = (NettyHttpServerEngine)jd4.getEngine();
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), false);

        /*NettyHttpDestination jd5 =
            (NettyHttpDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "http://localhost:9100"));*/
       
View Full Code Here


            }
            //Engines

            List<NettyHttpServerEngine> engineList = new ArrayList<NettyHttpServerEngine>();
            for (NettyHttpServerEngineConfigType engine : config.getEngine()) {
                NettyHttpServerEngine eng = new NettyHttpServerEngine();
              
                if (engine.getHost() != null && !StringUtils.isEmpty(engine.getHost())) {
                    eng.setHost(engine.getHost());
                }
                if (engine.getReadIdleTime() != null) {
                    eng.setReadIdleTime(engine.getReadIdleTime());
                }
                if (engine.getWriteIdleTime() != null) {
                    eng.setWriteIdleTime(engine.getWriteIdleTime());
                }
                if (engine.getMaxChunkContentSize() != null) {
                    eng.setMaxChunkContentSize(engine.getMaxChunkContentSize());
                }
                if (engine.getPort() != null) {
                    eng.setPort(engine.getPort());
                }
                if (engine.isSessionSupport() != null) {
                    eng.setSessionSupport(engine.isSessionSupport());
                }
                if (engine.getThreadingParameters() != null) {
                    ThreadingParametersType threads = engine.getThreadingParameters();
                    ThreadingParameters rThreads = new ThreadingParameters();
                    rThreads.setThreadPoolSize(threads.getThreadPoolSize());
                    eng.setThreadingParameters(rThreads);
                }

                //eng.setServer(engine.getTlsServerParameters());
                if (engine.getTlsServerParameters() != null) {
                    TLSServerParameters parameter = null;
                    try {
                        parameter = new TLSServerParametersConfig(engine.getTlsServerParameters());
                        eng.setTlsServerParameters(parameter);
                    } catch (Exception e) {
                        throw new RuntimeException("Could not configure TLS for engine on  "
                            + eng.getHost() + ":" + eng.getPort(), e);
                    }
                }
                eng.finalizeConfig();

                engineList.add(eng);
            }
            factory.setEnginesList(engineList);
            //Unravel this completely.
View Full Code Here

TOP

Related Classes of org.apache.cxf.transport.http.netty.server.NettyHttpServerEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.