@Override protected void before() throws Throwable { docRoot.create(); httpServer = org.glassfish.grizzly.http.server.HttpServer.createSimpleServer(docRoot.getRoot().getAbsolutePath()); httpServer.start(); }
public void run(CompletableFuture start, JaxRsServletConfigurer jaxRsConfigurer, CompletableFuture end) { WebappContext webappContext = new WebappContext("WebappContext", ""); new ServletContextListenerConfigurer(serverData, servletContextListenerData, servletRequestListenerData); jaxRsConfigurer.addServlet(this.serverData,webappContext); new ServletConfigurer(serverData, servletData).addServlets(webappContext); new FilterConfigurer(serverData, this.filterData).addFilters(webappContext); addListeners(webappContext); HttpServer httpServer = HttpServer.createSimpleServer(null, "0.0.0.0", serverData.getPort()); serverData.getModule().getServerConfigManager().accept(new WebServerProvider(httpServer)); addAccessLog(httpServer); addSSL(httpServer); startServer(webappContext, httpServer, start, end); }
/** * @param docRoot the document root, * can be <code>null</code> when no static pages are needed * * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the specified <code>docRoot</code> as the server's document root */ public static HttpServer createSimpleServer(final String docRoot) { return createSimpleServer(docRoot, NetworkListener.DEFAULT_NETWORK_PORT); }
/** * @param docRoot the document root, * can be <code>null</code> when no static pages are needed * * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the specified <code>docRoot</code> as the server's document root */ public static HttpServer createSimpleServer(final String docRoot) { return createSimpleServer(docRoot, NetworkListener.DEFAULT_NETWORK_PORT); }
/** * @param docRoot the document root, * can be <code>null</code> when no static pages are needed * * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the specified <code>docRoot</code> as the server's document root */ public static HttpServer createSimpleServer(final String docRoot) { return createSimpleServer(docRoot, NetworkListener.DEFAULT_NETWORK_PORT); }
/** * @param docRoot the document root, * can be <code>null</code> when no static pages are needed * * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the specified <code>docRoot</code> as the server's document root */ public static HttpServer createSimpleServer(final String docRoot) { return createSimpleServer(docRoot, NetworkListener.DEFAULT_NETWORK_PORT); }
/** * @param docRoot the document root, * can be <code>null</code> when no static pages are needed * * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the specified <code>docRoot</code> as the server's document root */ public static HttpServer createSimpleServer(final String docRoot) { return createSimpleServer(docRoot, NetworkListener.DEFAULT_NETWORK_PORT); }
/** * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the directory in which the server was launched the server's document root */ public static HttpServer createSimpleServer() { return createSimpleServer("."); }
/** * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the directory in which the server was launched the server's document root */ public static HttpServer createSimpleServer() { return createSimpleServer("."); }
/** * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the directory in which the server was launched the server's document root */ public static HttpServer createSimpleServer() { return createSimpleServer("."); }
/** * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the directory in which the server was launched the server's document root */ public static HttpServer createSimpleServer() { return createSimpleServer("."); }
/** * @param docRoot the document root, * can be <code>null</code> when no static pages are needed * * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the specified <code>docRoot</code> as the server's document root */ public static HttpServer createSimpleServer(final String docRoot) { return createSimpleServer(docRoot, NetworkListener.DEFAULT_NETWORK_PORT); }
/** * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the directory in which the server was launched the server's document root */ public static HttpServer createSimpleServer() { return createSimpleServer("."); }
/** * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the directory in which the server was launched the server's document root */ public static HttpServer createSimpleServer() { return createSimpleServer("."); }
/** * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the directory in which the server was launched the server's document root */ public static HttpServer createSimpleServer() { return createSimpleServer("."); }
/** * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the directory in which the server was launched the server's document root */ public static HttpServer createSimpleServer() { return createSimpleServer("."); }
/** * @param docRoot the document root, * can be <code>null</code> when no static pages are needed * * @return a <code>HttpServer</code> configured to listen to requests * on {@link NetworkListener#DEFAULT_NETWORK_HOST}:{@link NetworkListener#DEFAULT_NETWORK_PORT}, * using the specified <code>docRoot</code> as the server's document root */ public static HttpServer createSimpleServer(final String docRoot) { return createSimpleServer(docRoot, NetworkListener.DEFAULT_NETWORK_PORT); }
/** * This constructor allows to specify the port beside stubs. * If the port is busy, Restito won't try to pick different one and java.net.BindException will be thrown. */ public StubServer(int port, Stub... stubs) { this.stubs.addAll(Arrays.asList(stubs)); simpleServer = HttpServer.createSimpleServer(null, port); }
/** * This constructor allows to specify the port range beside stubs. * Grizzly will select the first available port. */ public StubServer(int portRangeStart, int portRangeEnd, Stub... stubs) { this.stubs.addAll(Arrays.asList(stubs)); simpleServer = HttpServer.createSimpleServer(null, new PortRange(portRangeStart, portRangeEnd)); }
@Override protected void setUp() throws Exception { super.setUp(); stopHttpServer(); httpServer = HttpServer.createSimpleServer("./", PORT); final Collection<NetworkListener> listeners = httpServer.getListeners(); for (NetworkListener listener : listeners) { listener.registerAddOn(new CometAddOn()); } httpServer.start(); cometContext = CometEngine.getEngine().register(TEST_TOPIC); }