Package org.eclipse.jetty.server.nio

Examples of org.eclipse.jetty.server.nio.SelectChannelConnector


  }

  public static Server startServer() throws Exception {
    Server server = new Server();

    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setPort(8888);
    server.addConnector(connector);

    WebAppContext webApp = new WebAppContext();
    webApp.setContextPath("/");
    webApp.setWar("src/main/webapp");
View Full Code Here


public class Start {

    public static void main(String[] args) throws Exception {
        Server server = new Server();
        SelectChannelConnector connector = new SelectChannelConnector();

        // Set some timeout options to make debugging easier.
        connector.setMaxIdleTime(1000 * 60 * 60);
        connector.setSoLingerTime(-1);
        connector.setPort(8080);
        server.setConnectors(new Connector[]{connector});

        WebAppContext webapp = new WebAppContext("src/main/webapp", "/");
        HandlerCollection contexts = new ContextHandlerCollection();
        contexts.addHandler(webapp);
View Full Code Here

   
   
   
    public Connector createDefaultConnector(String portnum) throws Exception
    {
        SelectChannelConnector connector = new SelectChannelConnector();
        connector = new SelectChannelConnector();
        int port = ((portnum==null||portnum.equals(""))?DEFAULT_PORT:Integer.parseInt(portnum.trim()));
        connector.setPort(port);
        connector.setMaxIdleTime(DEFAULT_MAX_IDLE_TIME);
       
        return connector;
    }
View Full Code Here

        } catch (Exception ex) {
            // expect the excepion
        }

        engine = new JettyHTTPServerEngine();
        conn = new SelectChannelConnector();
        conn.setPort(9002);
        engine.setConnector(conn);
        engine.setPort(9000);
        try {
            engine.finalizeConfig();
View Full Code Here

            public AbstractConnector createConnector(int porto) {
                return createConnector(null, porto);
            }
            public AbstractConnector createConnector(String hosto, int porto) {
                // now we just use the SelectChannelConnector as the default connector
                SelectChannelConnector result =
                    new SelectChannelConnector();
               
                // Regardless the port has to equal the one
                // we are configured for.
                assert porto == port;
                assert hosto == null ? host == null : hosto.equals(host);
                if (hosto != null) {
                    result.setHost(hosto);
                }
                result.setPort(porto);
                if (getMaxIdleTime() > 0) {
                    result.setMaxIdleTime(getMaxIdleTime());
                }
                return result;
            }
        };
    }
View Full Code Here

        servletContext.addServlet(holder, "/system/console/topology/*");

        jettyServer = new Server();
        jettyServer.setHandler(servletContext);
        Connector connector=new SelectChannelConnector();
        jettyServer.setConnectors(new Connector[]{connector});
        jettyServer.start();
    }
View Full Code Here

            Connector connector = null;

            Collection<Transport> transports = port.getTransports();
            if (!transports.contains(Transport.SSL))
            {
                connector = new SelectChannelConnector();
            }
            else if (transports.contains(Transport.SSL))
            {
                KeyStore keyStore = port.getKeyStore();
                if (keyStore == null)
View Full Code Here

    // META-INF/resources directory
    System.setProperty(DandelionConfig.OVERRIDE_SERVLET3.getName(), "false");
       
    // Create a new web server
    server = new Server();
    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setHost(SERVER_HOST);
    connector.setPort(SERVER_PORT);
    server.addConnector(connector);

    context = new WebAppContext("src/test/webapp", "/");
    context.addServlet(ThymeleafServlet.class, "/thymeleaf/*");

 
View Full Code Here

        webapp.setExtractWAR(true);
        webapp.setWar(args[0]);
        webapp.setDefaultsDescriptor(webdefaultPath());

        Server server = new Server();
        Connector connector = new SelectChannelConnector();
        connector.setPort(Integer.getInteger("jetty.port",8080).intValue());
        server.setConnectors(new Connector[]{connector});
        server.setHandler(webapp);
        server.start();
        server.join();
    }
View Full Code Here

    // META-INF/resources directory
    System.setProperty(DandelionConfig.OVERRIDE_SERVLET3.getName(), "false");
   
    // Create a new web server
    server = new Server();
    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setHost(SERVER_HOST);
    connector.setPort(SERVER_PORT);
    server.addConnector(connector);

    context = new WebAppContext("src/test/webapp", "/");
    context.setParentLoaderPriority(true);
   
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.nio.SelectChannelConnector

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.