Package org.glassfish.grizzly.http.server

Examples of org.glassfish.grizzly.http.server.HttpServer.start()


//                new PlainTextHttpHandler(), "/plaintext");
//        httpServer.getServerConfiguration().addHttpHandler(
//                new JsonHttpHandler(), "/json");
       
        try {
            httpServer.start();
           
            System.err.print("Server started.\n");
            synchronized (Server.class) {
    Server.class.wait();
            }
View Full Code Here


    rc.setPropertiesAndFeatures(properties());
    rc.getContainerResponseFilters().add(new ServerResponseFilter());
    HttpServer server = GrizzlyServerFactory.createHttpServer(baseUri, rc);

    try {
        server.start();

        System.err.print("Server started.\n");
        synchronized (JerseyWebServer.class) {
            JerseyWebServer.class.wait();
        }
View Full Code Here

        // Map the path to the processor.
        final ServerConfiguration config = server.getServerConfiguration();
        config.addHttpHandler(handler, u.getPath());

        // Start the server.
        server.start();
        return server;
    }

    public static HttpServer createHttpServer(
            final URI u,
View Full Code Here

        config.setPassTraceRequest(true);

        if (start) {
            try {
                // Start the server.
                server.start();
            } catch (final IOException ex) {
                server.shutdownNow();
                throw new ProcessingException(LocalizationMessages.FAILED_TO_START_SERVER(ex.getMessage()), ex);
            }
        }
View Full Code Here

        config.addHttpHandler(RuntimeDelegate.getInstance().createEndpoint(createResourceConfig(), GrizzlyHttpContainer.class),
                APP_PATH);

        try {
            // Start the server.
            server.start();
        } catch (Exception ex) {
            throw new ProcessingException("Exception thrown when trying to start grizzly server", ex);
        }

        return server;
View Full Code Here

        config.addHttpHandler(RuntimeDelegate.getInstance().createEndpoint(createResourceConfig(), GrizzlyHttpContainer.class),
                APP_PATH);

        try {
            // Start the server.
            server.start();
        } catch (Exception ex) {
            throw new ProcessingException("Exception thrown when trying to start grizzly server", ex);
        }

        return server;
View Full Code Here

        config.addHttpHandler(RuntimeDelegate.getInstance().createEndpoint(createResourceConfig(), GrizzlyHttpContainer.class),
                API_PATH);

        try {
            // Start the server.
            server.start();
        } catch (Exception ex) {
            throw new ProcessingException("Exception thrown when trying to start grizzly server", ex);
        }

        return server;
View Full Code Here

    if (argv.length > 0) {
      String cmd = argv[0];
      String[] args = Arrays.copyOfRange(argv, 1, argv.length);
      if (cmd.equals("standalone")) {
        HttpServer ws = createWebServer(args);
        ws.start();
        Thread.currentThread().join(0);
        return;
      } else if (cmd.equals("uploadcode")) {
        uploadCode(args);
        return;
View Full Code Here

    File tempFile = File.createTempFile("MainTest", "ser");
    assertTrue(tempFile.delete());
    File bagDir = Util.createTempDirectory("MainTest_bag");
    try {
      HttpServer ws = Main.createWebServer(new String[]{"--port=10801", "--createmode=OPEN", "-m", tempFile.getAbsolutePath()});
      ws.start();
      Thread.currentThread().sleep(1000);
      try {
        baseUrl = "http://localhost:10801";
        Object ret;
        ret = call("_meta","execute",Util.literalSMap().p("code","repo.getDbNames()"));
View Full Code Here

        // Graph graph = gs.getGraph();
        // httpServer.getServerConfiguration().addHttpHandler(new OTPHttpHandler(graph), "/test/*");
       
        /* RELINQUISH CONTROL TO THE SERVER THREAD */
        try {
            httpServer.start();
            LOG.info("Grizzly server running.");
            Thread.currentThread().join();
        } catch (BindException be) {
            LOG.error("Cannot bind to port {}. Is it already in use?", params.port);
        } catch (IOException ioe) {
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.