Package com.sun.net.httpserver

Examples of com.sun.net.httpserver.HttpServer.start()


        server.setExecutor(Executors.newCachedThreadPool());
        server.createContext("/", fileserver);
        server.createContext("/ui", fileserver).setAuthenticator(authenticator);
        server.createContext("/qpid/connection", qpidserver).setAuthenticator(authenticator);
        server.start();
    }

    /**
     * Runs QpidRestAPI.
     * @param args the command line arguments.
View Full Code Here


                  logger.error("http handle error", t);
                }
            }

          });
      httpServer.start();
    } catch (Throwable e) {
      logger.error("nested http server error", e);
    }
  }
 
View Full Code Here

   */
  public GoogleEarthKMLProvider(int port) {
    try {
      HttpServer server = HttpServer.create(new InetSocketAddress(port), 0);
      server.createContext( "/", new KMLCodeProvider() );
      server.start();
    } catch (IOException e) {
      System.out.println("IOException in GoogleEarthKMLProvider(): " + e.getMessage());
    }
  }
 
View Full Code Here

        server.setExecutor(Executors.newCachedThreadPool());
        server.createContext("/", fileserver);
        server.createContext("/ui", fileserver).setAuthenticator(authenticator);
        server.createContext("/qpid/connection", qpidserver).setAuthenticator(authenticator);
        server.start();
    }

    /**
     * Runs QpidRestAPI.
     * @param args the command line arguments.
View Full Code Here

      for(final Entry<String, HttpHandler> entry: Endpoint.registeredhandler.entrySet()){
        server.createContext(entry.getKey(), entry.getValue());
      }

      server.setExecutor(null);
      server.start();
    } catch (final Exception e) {
      System.err.println(e);
      e.printStackTrace();
    }
  }
View Full Code Here

            server.createContext("/getscreen", new ConsoleProxyThumbnailHandler());
            server.createContext("/resource/", new ConsoleProxyResourceHandler());
            server.createContext("/ajax", new ConsoleProxyAjaxHandler());
            server.createContext("/ajaximg", new ConsoleProxyAjaxImageHandler());
            server.setExecutor(new ThreadExecutor()); // creates a default executor
            server.start();
        } catch(Exception e) {
            s_logger.error(e.getMessage(), e);
            System.exit(1);
        }
    }
View Full Code Here

        try {
            s_logger.info("Listening for HTTP CMDs on port " + httpCmdListenPort);
            HttpServer cmdServer = HttpServer.create(new InetSocketAddress(httpCmdListenPort), 2);
            cmdServer.createContext("/cmd", new ConsoleProxyCmdHandler());
            cmdServer.setExecutor(new ThreadExecutor()); // creates a default executor
            cmdServer.start();
        } catch(Exception e) {
            s_logger.error(e.getMessage(), e);
            System.exit(1);
        }
    }
View Full Code Here

                    out.flush();
                    e.close();
                }
            };
            server.createContext("/", handler);
            server.start();
           
            URI u = UriBuilder.fromUri("http://localhost/").port(port).build();
            WebResource r = c.resource(u);

            String s = r.type("text/plain").post(String.class, "CONTENT");
View Full Code Here

            }
            HttpServer server = HttpServer.create(
                    new InetSocketAddress((Integer) opts[1].value), 0);
            server.createContext("/", new MyHandler());
            server.setExecutor(null);
            server.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }        // TODO code application logic here
View Full Code Here

      // Add filters to the context
      ctx.getFilters().add(new SimpleFilter("Filter01"));
      ctx.getFilters().add(new SimpleFilter("Filter02"));
      ctx.getFilters().add(new SimpleFilter("Filter03"));
      // Start the server
      ehs.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
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.