Package org.eclipse.jetty.server.bio

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


public class Start {
    public static void main(String[] args) throws Exception {
        int timeout = (int) Duration.ONE_HOUR.getMilliseconds();

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

        // Set some timeout options to make debugging easier.
        connector.setMaxIdleTime(timeout);
        connector.setSoLingerTime(-1);
        connector.setPort(8080);
        server.addConnector(connector);

        Resource keystore = Resource.newClassPathResource("/keystore");
        if (keystore != null && keystore.exists()) {
            // if a keystore for a SSL certificate is available, start a SSL
            // connector on port 8443.
            // By default, the quickstart comes with a Apache Wicket Quickstart
            // Certificate that expires about half way september 2021. Do not
            // use this certificate anywhere important as the passwords are
            // available in the source.

            connector.setConfidentialPort(8443);

            SslContextFactory factory = new SslContextFactory();
            factory.setKeyStoreResource(keystore);
            factory.setKeyStorePassword("wicket");
            factory.setTrustStoreResource(keystore);
View Full Code Here


public class Start {
    public static void main(String[] args) throws Exception {
        int timeout = (int) Duration.ONE_HOUR.getMilliseconds();

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

        // Set some timeout options to make debugging easier.
        connector.setMaxIdleTime(timeout);
        connector.setSoLingerTime(-1);
        connector.setPort(8080);
        server.addConnector(connector);

    // check if a keystore for a SSL certificate is available, and
    // if so, start a SSL connector on port 8443. By default, the
    // quickstart comes with a Apache Wicket Quickstart Certificate
    // that expires about half way september 2021. Do not use this
    // certificate anywhere important as the passwords are available
    // in the source.

        Resource keystore = Resource.newClassPathResource("/keystore");
        if (keystore != null && keystore.exists()) {
            connector.setConfidentialPort(8443);

            SslContextFactory factory = new SslContextFactory();
            factory.setKeyStoreResource(keystore);
            factory.setKeyStorePassword("wicket");
            factory.setTrustStoreResource(keystore);
View Full Code Here

        return version;
    }

    private boolean initializeHttp()
    {
        Connector connector = this.config.isUseHttpNio() ? new SelectChannelConnector() : new SocketConnector();
        configureConnector(connector, this.config.getHttpPort());
        return startConnector(connector);
    }
View Full Code Here

    @Before
    public void setup() {
        server = new Server();

        final SocketConnector connector = new SocketConnector();

        connector.setMaxIdleTime(1000 * 60 * 60);
        connector.setPort(8080);
        server.setConnectors(new Connector[] {connector});

        final WebAppContext context = new WebAppContext();
        context.setServer(server);
        context.setContextPath("/BraveRestEasyIntegration");
View Full Code Here

     private static Connector buildConnector() {
        Connector connector;
        if (usingNIO) {
            connector = new SelectChannelConnector();
        } else {
            connector = new SocketConnector();
        }
        connector.setPort(jettyPort);
        connector.setMaxIdleTime(maxIdleTime);
        return connector;
    }
View Full Code Here

    public final void testStaleConnection() throws Exception {
        Server server = startServer(new ResourcesResponseHandler(), 8089);
        Connector[] connectors = server.getConnectors();
        for (Connector connector : connectors) {
            if (connector instanceof SocketConnector) {
                SocketConnector sConnector = (SocketConnector) connector;
                sConnector.setSoLingerTime(-1);
            }
        }

        BaseFetcher fetcher = new SimpleHttpFetcher(1, ConfigUtils.BIXO_TEST_AGENT);
        String url = "http://localhost:8089/simple-page.html";
View Full Code Here

  void start() {
    if (server != null) {
      throw new RuntimeException("Server is already started");
    } else {
      server = new Server();
      final SocketConnector connector = new SocketConnector();
      connector.setMaxIdleTime(60 * 1000);
      connector.setSoLingerTime(-1);
      connector.setPort(0);
      server.addConnector(connector);

      QueuedThreadPool threadPool = new QueuedThreadPool();
      threadPool.setDaemon(true);
      server.setThreadPool(threadPool);
View Full Code Here

{

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

    // 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 bb = new WebAppContext();
    bb.setServer(server);
    bb.setContextPath("/");
View Full Code Here

  public static void main(String[] args)
  {
// System.setProperty("wicket.configuration", "development");

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

    // 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 bb = new WebAppContext();
    bb.setServer(server);
    bb.setContextPath("/");
View Full Code Here

/**
* @version $Rev: 759104 $ $Date: 2009-03-27 19:21:58 +0800 (Fri, 27 Mar 2009) $
*/
public class HTTPSocketConnector extends JettyConnector {
    public HTTPSocketConnector(JettyContainer container, ThreadPool threadPool) {
        super(container, new SocketConnector(), threadPool, "HTTPSocketConnector");
    }
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.