use of com.sun.net.httpserver.HttpServer in project elasticsearch by elastic.
the class RestClientMultipleHostsIntegTests method stopHttpServers.
@AfterClass
public static void stopHttpServers() throws IOException {
restClient.close();
restClient = null;
for (HttpServer httpServer : httpServers) {
httpServer.stop(0);
}
httpServers = null;
}
use of com.sun.net.httpserver.HttpServer in project pinot by linkedin.
the class MultiGetRequestTest method startServer.
private HttpServer startServer(int port, HttpHandler handler) throws IOException {
final HttpServer server = HttpServer.create(new InetSocketAddress(port), 0);
server.createContext(URI_PATH, handler);
new Thread(new Runnable() {
@Override
public void run() {
server.start();
}
}).start();
servers.add(server);
return server;
}
use of com.sun.net.httpserver.HttpServer in project pinot by linkedin.
the class ServerTableSizeReaderTest method startServer.
private HttpServer startServer(int port, HttpHandler handler) throws IOException {
final HttpServer server = HttpServer.create(new InetSocketAddress(port), 0);
server.createContext(URI_PATH, handler);
new Thread(new Runnable() {
@Override
public void run() {
server.start();
}
}).start();
return server;
}
use of com.sun.net.httpserver.HttpServer in project heron by twitter.
the class SchedulerServer method createServer.
protected HttpServer createServer(int port, Executor executor) throws IOException {
HttpServer server = HttpServer.create(new InetSocketAddress(port), SERVER_BACK_LOG);
server.setExecutor(executor);
return server;
}
use of com.sun.net.httpserver.HttpServer in project cloudstack by apache.
the class ConsoleProxy method startupHttpMain.
private static void startupHttpMain() {
try {
ConsoleProxyServerFactory factory = getHttpServerFactory();
if (factory == null) {
s_logger.error("Unable to load HTTP server factory");
System.exit(1);
}
HttpServer server = factory.createHttpServerInstance(httpListenPort);
server.createContext("/getscreen", new ConsoleProxyThumbnailHandler());
server.createContext("/resource/", new ConsoleProxyResourceHandler());
server.createContext("/ajax", new ConsoleProxyAjaxHandler());
server.createContext("/ajaximg", new ConsoleProxyAjaxImageHandler());
// creates a default executor
server.setExecutor(new ThreadExecutor());
server.start();
} catch (Exception e) {
s_logger.error(e.getMessage(), e);
System.exit(1);
}
}
Aggregations