Package org.eclipse.jetty.server.bio

Examples of org.eclipse.jetty.server.bio.SocketConnector


    }

    protected void doStart() throws Exception {
        server = new Server();
        if (connector == null) {
            connector = new SocketConnector();
        }
        connector.setHost(bindAddress.getHost());
        connector.setPort(bindAddress.getPort());
        connector.setServer(server);
        server.setConnectors(new Connector[] {
View Full Code Here


        System.setProperty( "org.eclipse.xml.XmlParser.NotValidating", "true" );
        server = new Server();
        server.setStopAtShutdown( true );
       
        // Create HTTP listener
        SocketConnector connector = new SocketConnector();
        connector.setHost( "localhost" );
        connector.setPort( HTTP_PORT );
        connector.setMaxIdleTime( 60000 );

        server.setConnectors( new Connector[] {connector} );
        log.info( "added HTTP listener for port " + HTTP_PORT );

        // add the shutdown handler
View Full Code Here

    public static void main(String[] args) throws Exception {
        disableJavaLogging();

        Server server = new Server();
        SocketConnector connector = new SocketConnector();

        connector.setMaxIdleTime(1000 * 60 * 60);
        connector.setSoLingerTime(-1);
        connector.setPort(determineServerPort());
        server.setConnectors(new Connector[]{connector});

        WebAppContext context = new WebAppContext();
        context.setServer(server);
        context.setContextPath("/");

        ProtectionDomain protectionDomain = Launcher.class.getProtectionDomain();
        URL location = protectionDomain.getCodeSource().getLocation();
        context.setWar(location.toExternalForm());

        server.setHandler(context);
        server.start();

        Desktop.getDesktop().browse(URI.create("http://localhost:" + connector.getPort() + "/"));
       
        server.join();
    }
View Full Code Here

      c.setReuseAddress(true);
      c.setLowResourcesMaxIdleTime(1500);
      connector = c;
      threadPool = (QueuedThreadPool) c.getThreadPool();
    } else if ("Socket".equals(connectorName)) {
      final SocketConnector c = useSsl ? new SslSocketConnector(sslcontext) : new SocketConnector();
      c.setReuseAddress(true);
      connector = c;
      threadPool = (QueuedThreadPool) c.getThreadPool();
    } else {
      throw new IllegalArgumentException("Illegal value for system property 'tests.jettyConnector': " + connectorName);
    }
   
    connector.setPort(0);
View Full Code Here

    private WebServer() {
    }

    public static void main(String[] args) throws Exception {
        Server server = new Server();
        Connector context = new SocketConnector();
        context.setServer(server);
        context.setPort(PORT);

        String webappDir = WEBAPP_DIR;
        if (args.length > 0) {
            webappDir = args[0];
        }
View Full Code Here

        return https.getKeyAlias();
    }
   
    //TODO does this make sense???
    public void setRedirectPort(int port) {
        SocketConnector socketListener = (SocketConnector) listener;
        socketListener.setConfidentialPort(port);
        socketListener.setIntegralPort(port);
        socketListener.setIntegralScheme("https");
        socketListener.setConfidentialScheme("https");
    }
View Full Code Here

/**
* @version $Rev: 882333 $ $Date: 2009-11-19 17:21:48 -0500 (Thu, 19 Nov 2009) $
*/
public class HTTPSocketConnector extends JettyConnector {
    public HTTPSocketConnector(JettyContainer container, ThreadPool threadPool) {
        super(container, new SocketConnector(), threadPool, "HTTPSocketConnector");
    }
View Full Code Here

    public int getDefaultPort() {
        return 80;
    }

    public void setRedirectPort(int port) {
        SocketConnector socketListener = (SocketConnector) listener;
        socketListener.setConfidentialPort(port);
        socketListener.setIntegralPort(port);
        socketListener.setIntegralScheme("https");
        socketListener.setConfidentialScheme("https");
    }
View Full Code Here

*/
public class RequestFactoryTestServer {
  public static void main(String[] args) {
    Server server = new Server();

    SocketConnector connector = new SocketConnector();
    connector.setPort(9999);
    server.addConnector(connector);

    ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
    handler.setContextPath("/");
    handler.addServlet(RequestFactoryServlet.class, "/gwtRequest");
View Full Code Here

        System.setProperty( "org.eclipse.xml.XmlParser.NotValidating", "true" );
        server = new Server();
        server.setStopAtShutdown( true );
       
        // Create HTTP listener
        SocketConnector connector = new SocketConnector();
        connector.setHost( "localhost" );
        connector.setPort( HTTP_PORT );
        connector.setMaxIdleTime( 60000 );

        server.setConnectors( new Connector[] {connector} );
        log.info( "added HTTP listener for port " + HTTP_PORT );

        // add the shutdown handler
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.bio.SocketConnector

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.