Examples of JettyHTTPDestination


Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

        server.start();
    }

    private void registerListServiceHandler() {
        if (server.getDestination() instanceof JettyHTTPDestination) {
            JettyHTTPDestination jettyDest = (JettyHTTPDestination) server.getDestination();
            JettyHTTPServerEngine jettyEng = (JettyHTTPServerEngine) jettyDest.getEngine();
            List<Handler> handlers = jettyEng.getHandlers();
            if (handlers == null) {
                handlers = new ArrayList<Handler>();
                jettyEng.setHandlers(handlers);
            }
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

       
        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
        DestinationFactory factory = dfm.getDestinationFactory("http://cxf.apache.org/transports/http");
        Destination d = factory.getDestination(info);
        assertTrue(d instanceof JettyHTTPDestination);
        JettyHTTPDestination jd = (JettyHTTPDestination) d;       
        assertEquals("foobar", jd.getServer().getContentEncoding());  
       
        JettyHTTPServerEngine engine = (JettyHTTPServerEngine)jd.getEngine();
        assertEquals(111, engine.getThreadingParameters().getMinThreads());
        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
       
        ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
        ConduitInitiator ci = cim.getConduitInitiator("http://cxf.apache.org/transports/http");
        HTTPConduit conduit = (HTTPConduit) ci.getConduit(info);
        assertEquals(97, conduit.getClient().getConnectionTimeout());
       
        info.setName(new QName("urn:test:ns", "Bar"));
        conduit = (HTTPConduit) ci.getConduit(info);
        assertEquals(79, conduit.getClient().getConnectionTimeout());

        JettyHTTPDestination jd2 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("foo", "bar", "http://localhost:9001"));
       
        engine = (JettyHTTPServerEngine)jd2.getEngine();
        assertEquals(99, engine.getThreadingParameters().getMinThreads());
        assertEquals(777, engine.getThreadingParameters().getMaxThreads());
        assertTrue("The engine should support session manager", engine.isSessionSupport());
        assertNotNull("The handlers should not be null", engine.getHandlers());
        assertEquals(1, engine.getHandlers().size());
        assertTrue("The connector should be instance of org.eclipse.jetty.server.bio.SocketConnector",
                   engine.getConnector() instanceof org.eclipse.jetty.server.bio.SocketConnector);
       
        JettyHTTPDestination jd3 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "https://localhost:9002"));
       
        engine = (JettyHTTPServerEngine)jd3.getEngine();
        assertEquals(111, engine.getThreadingParameters().getMinThreads());
        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), true);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), true);
       
        JettyHTTPDestination jd4 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo2", "https://localhost:9003"));
       
        engine = (JettyHTTPServerEngine)jd4.getEngine();
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), false);

        JettyHTTPDestination jd5 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "http://localhost:9100"));
       
        engine = (JettyHTTPServerEngine)jd5.getEngine();
        String r = "expected fallback thread parameters configured for port 0";
        assertNotNull(r, engine.getThreadingParameters());
        assertEquals(r, 21, engine.getThreadingParameters().getMinThreads());
        assertEquals(r, 389, engine.getThreadingParameters().getMaxThreads());
    }
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

        setUpBus(true);
      
        Bus bus = (Bus)applicationContext.getBean("cxf");
        ServerRegistry sr = bus.getExtension(ServerRegistry.class);
        ServerImpl si = (ServerImpl) sr.getServers().get(0);
        JettyHTTPDestination jhd = (JettyHTTPDestination) si.getDestination();
        JettyHTTPServerEngine e = (JettyHTTPServerEngine) jhd.getEngine();
        org.eclipse.jetty.server.Server jettyServer = e.getServer();

        Handler[] contexts = jettyServer.getChildHandlersByClass(WebAppContext.class);
        WebAppContext servletContext = null;
        for (Handler h : contexts) {
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

       
        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
        Destination d =
            dfm.getDestinationFactory("http://schemas.xmlsoap.org/soap/http").getDestination(info);
        assertTrue(d instanceof JettyHTTPDestination);
        JettyHTTPDestination jd = (JettyHTTPDestination) d;
        assertEquals("foobar", jd.getServer().getContentEncoding());
       
        ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
        ConduitInitiator ci = cim.getConduitInitiator("http://schemas.xmlsoap.org/soap/http");
        HTTPConduit conduit = (HTTPConduit) ci.getConduit(info);
        assertEquals(97, conduit.getClient().getConnectionTimeout());
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

        server.start();
    }

    private void registerListServiceHandler() {
        if (server.getDestination() instanceof JettyHTTPDestination) {
            JettyHTTPDestination jettyDest = (JettyHTTPDestination) server.getDestination();
            JettyHTTPServerEngine jettyEng = (JettyHTTPServerEngine) jettyDest.getEngine();
            List<Handler> handlers = jettyEng.getHandlers();
            if (handlers == null) {
                handlers = new ArrayList<Handler>();
                jettyEng.setHandlers(handlers);
            }
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

        writer.write("Known services on cxf bc component are: <ul>");

        List<Server> servers = serverRegistry.getServers();
        for (Iterator iter = servers.iterator(); iter.hasNext();) {
            Server server = (Server) iter.next();
            JettyHTTPDestination jhd = (JettyHTTPDestination)server.getDestination();
            String address = jhd.getAddress().getAddress().getValue();
            writer.write("<li><a href=\"");
            writer.write(address);
            writer.write("?wsdl\">");
            writer.write(address);
            writer.write("</a></li>\n");
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

        setUpBus(true);
      
        Bus bus = (Bus)applicationContext.getBean("cxf");
        ServerRegistry sr = bus.getExtension(ServerRegistry.class);
        ServerImpl si = (ServerImpl) sr.getServers().get(0);
        JettyHTTPDestination jhd = (JettyHTTPDestination) si.getDestination();
        JettyHTTPServerEngine e = (JettyHTTPServerEngine) jhd.getEngine();
        org.eclipse.jetty.server.Server jettyServer = e.getServer();

        Handler[] contexts = jettyServer.getChildHandlersByClass(WebAppContext.class);
        WebAppContext servletContext = null;
        for (Handler h : contexts) {
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

       
        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
        DestinationFactory factory = dfm.getDestinationFactory("http://cxf.apache.org/transports/http");
        Destination d = factory.getDestination(info);
        assertTrue(d instanceof JettyHTTPDestination);
        JettyHTTPDestination jd = (JettyHTTPDestination) d;       
        assertEquals("foobar", jd.getServer().getContentEncoding());  
       
        JettyHTTPServerEngine engine = (JettyHTTPServerEngine)jd.getEngine();
        assertEquals(111, engine.getThreadingParameters().getMinThreads());
        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
       
        ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
        ConduitInitiator ci = cim.getConduitInitiator("http://cxf.apache.org/transports/http");
        HTTPConduit conduit = (HTTPConduit) ci.getConduit(info);
        assertEquals(97, conduit.getClient().getConnectionTimeout());
       
        info.setName(new QName("urn:test:ns", "Bar"));
        conduit = (HTTPConduit) ci.getConduit(info);
        assertEquals(79, conduit.getClient().getConnectionTimeout());

        JettyHTTPDestination jd2 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("foo", "bar", "http://localhost:9001"));
       
        engine = (JettyHTTPServerEngine)jd2.getEngine();
        assertEquals(40000, engine.getMaxIdleTime());
        assertFalse(engine.getSendServerVersion());
        assertEquals(99, engine.getThreadingParameters().getMinThreads());
        assertEquals(777, engine.getThreadingParameters().getMaxThreads());
        assertTrue("The engine should support session manager", engine.isSessionSupport());
        assertNotNull("The handlers should not be null", engine.getHandlers());
        assertEquals(1, engine.getHandlers().size());
        assertTrue("The connector should be instance of org.eclipse.jetty.server.bio.SocketConnector",
                   engine.getConnector() instanceof org.eclipse.jetty.server.bio.SocketConnector);
       
        JettyHTTPDestination jd3 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "https://localhost:9002"));
       
        engine = (JettyHTTPServerEngine)jd3.getEngine();
        assertEquals(111, engine.getThreadingParameters().getMinThreads());
        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), true);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), true);
       
        JettyHTTPDestination jd4 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo2", "https://localhost:9003"));
       
        engine = (JettyHTTPServerEngine)jd4.getEngine();
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), false);

        JettyHTTPDestination jd5 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "http://localhost:9100"));
       
        engine = (JettyHTTPServerEngine)jd5.getEngine();
        String r = "expected fallback thread parameters configured for port 0";
        assertNotNull(r, engine.getThreadingParameters());
        assertEquals(r, 21, engine.getThreadingParameters().getMinThreads());
        assertEquals(r, 389, engine.getThreadingParameters().getMaxThreads());
    }
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

       
        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
        DestinationFactory factory = dfm.getDestinationFactory("http://cxf.apache.org/transports/http");
        Destination d = factory.getDestination(info, bus);
        assertTrue(d instanceof JettyHTTPDestination);
        JettyHTTPDestination jd = (JettyHTTPDestination) d;       
        assertEquals("foobar", jd.getServer().getContentEncoding());  
       
        JettyHTTPServerEngine engine = (JettyHTTPServerEngine)jd.getEngine();
        assertEquals(111, engine.getThreadingParameters().getMinThreads());
        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
       
        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());

        JettyHTTPDestination jd2 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("foo", "bar", "http://localhost:9001"), bus);
       
        engine = (JettyHTTPServerEngine)jd2.getEngine();
        assertEquals(40000, engine.getMaxIdleTime());
        assertFalse(engine.getSendServerVersion());
        assertEquals(99, engine.getThreadingParameters().getMinThreads());
        assertEquals(777, engine.getThreadingParameters().getMaxThreads());
        assertTrue("The engine should support session manager", engine.isSessionSupport());
        assertNotNull("The handlers should not be null", engine.getHandlers());
        assertEquals(1, engine.getHandlers().size());
        assertTrue("The connector should be instance of org.eclipse.jetty.server.bio.SocketConnector",
                   engine.getConnector() instanceof org.eclipse.jetty.server.bio.SocketConnector);
       
        JettyHTTPDestination jd3 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "https://localhost:9002"), bus);
       
        engine = (JettyHTTPServerEngine)jd3.getEngine();
        assertEquals(111, engine.getThreadingParameters().getMinThreads());
        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), true);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), true);
       
        JettyHTTPDestination jd4 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo2", "https://localhost:9003"), bus);
       
        engine = (JettyHTTPServerEngine)jd4.getEngine();
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), false);

        JettyHTTPDestination jd5 =
            (JettyHTTPDestination)factory.getDestination(
                getEndpointInfo("sna", "foo", "http://localhost:9100"), bus);
       
        engine = (JettyHTTPServerEngine)jd5.getEngine();
        String r = "expected fallback thread parameters configured for port 0";
        assertNotNull(r, engine.getThreadingParameters());
        assertEquals(r, 21, engine.getThreadingParameters().getMinThreads());
        assertEquals(r, 389, engine.getThreadingParameters().getMaxThreads());
    }
View Full Code Here

Examples of org.apache.cxf.transport.http_jetty.JettyHTTPDestination

       
       
        bean.setAddress("http://localhost:8080" + bean.getAddress());
        bean.setStart(false);
        Server server = bean.create();
        JettyHTTPDestination dest = (JettyHTTPDestination)server.getDestination();
        JettyHTTPServerEngine engine = (JettyHTTPServerEngine)dest.getEngine();
        engine.setSessionSupport(true);
       
        server.start();
        return server;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.