/** * Set the port that Spark should listen on. If not called the default port * is 4567. This has to be called before any route mapping is done. * If provided port = 0 then the an arbitrary available port will be used. * * @param port The port number * @deprecated replaced by {@link #port(int)} */ public static void setPort(int port) { getInstance().port(port); }
/** * Retrieves the port that Spark is listening on. * * @return The port Spark server is listening on. * @throws IllegalStateException when the server is not started */ public static int port() { return getInstance().port(); }
/** * Set the port that Spark should listen on. If not called the default port * is 4567. This has to be called before any route mapping is done. * If provided port = 0 then the an arbitrary available port will be used. * * @param port The port number */ public static void port(int port) { getInstance().port(port); }
/** * Set the port that Spark should listen on. If not called the default port * is 4567. This has to be called before any route mapping is done. * If provided port = 0 then the an arbitrary available port will be used. * * @param port The port number * @deprecated replaced by {@link #port(int)} */ public static void setPort(int port) { getInstance().port(port); }
/** * Set the port that Spark should listen on. If not called the default port * is 4567. This has to be called before any route mapping is done. * If provided port = 0 then the an arbitrary available port will be used. * * @param port The port number */ public static void port(int port) { getInstance().port(port); }
/** * Retrieves the port that Spark is listening on. * * @return The port Spark server is listening on. * @throws IllegalStateException when the server is not started */ public static int port() { return getInstance().port(); }
public void stop() { if(hgqlService != null) { LOGGER.info("Attempting to shut down service at http://localhost:" + hgqlService.port() + "..."); hgqlService.stop(); LOGGER.info("Shut down server"); } } }
public void stop() { if(hgqlService != null) { LOGGER.info("Attempting to shut down service at http://localhost:" + hgqlService.port() + "..."); hgqlService.stop(); LOGGER.info("Shut down server"); } } }
private String replacePort(String url) { return url.replace("$PORT$", String.valueOf(httpServer.port())); }
private String replacePort(String url) { return url.replace("$PORT$", String.valueOf(httpServer.port())); }
.port(WORKER_LISTEN_PORT) .threadPool(WORKER_SINGLE_POINT_THREADS); sparkHttpService.post("/single", new AnalysisWorkerController(this)::handleSinglePoint);
.port(WORKER_LISTEN_PORT) .threadPool(WORKER_SINGLE_POINT_THREADS); sparkHttpService.post("/single", new AnalysisWorkerController(this)::handleSinglePoint);
System.out.println("GraphiQL UI available at: http://localhost:" + config.getGraphqlConfig().port() + config.getGraphqlConfig().graphiQLPath()); hgqlService = Service.ignite().port(config.getGraphqlConfig().port());
System.out.println("GraphiQL UI available at: http://localhost:" + config.getGraphqlConfig().port() + config.getGraphqlConfig().graphiQLPath()); hgqlService = Service.ignite().port(config.getGraphqlConfig().port());
@Override public void configure(HierarchicalConfiguration config) throws ConfigurationException { if (configuration.isEnabled()) { service.port(configuration.getPort().get().getValue()); configureExceptionHanding(); configureHTTPS(); configureCORS(); configureMetrics(); service.before((request, response) -> response.type(Constants.JSON_CONTENT_TYPE)); configureMDC(); routesList.forEach(routes -> { service.before(routes.getBasePath(), authenticationFilter); service.before(routes.getBasePath() + "/*", authenticationFilter); routes.define(service); }); publicRoutes.forEach(routes -> routes.define(service)); service.awaitInitialization(); port = new Port(service.port()); LOGGER.info("Web admin server started"); } }
@Before public void setUp() throws Exception { httpServer = Service.ignite().port(RANDOM_PORT); httpServer.get("/", (Request request, Response response) -> "content"); httpServer.awaitInitialization(); rootDirectory = tmpFolder.getRoot(); createSubFolderWithAFileIn("conf", "conf.txt", "confcontent"); createSubFolderWithAFileIn("var", "var.txt", "varcontent"); fileSystem = buildFileSystem(rootDirectory.getAbsolutePath()); }
@Before public void setUp() throws Exception { httpServer = Service.ignite().port(RANDOM_PORT); httpServer.get("/", (Request request, Response response) -> "content"); httpServer.awaitInitialization(); rootDirectory = tmpFolder.getRoot(); createSubFolderWithAFileIn("conf", "conf.txt", "confcontent"); createSubFolderWithAFileIn("var", "var.txt", "varcontent"); fileSystem = buildFileSystem(rootDirectory.getAbsolutePath()); }
@Override public void initialize() { if (isInitialized()) { return; } service = Service.ignite() .ipAddress(configuration.bindAddress()) .port(configuration.bindPort()); service.path("/v1", () -> { service.get("/version", v1RequestHandler::handleGetVersion); service.get("/status", v1RequestHandler::handleGetStatus); service.delete("/kernel", v1RequestHandler::handleDeleteKernel); } ); service.exception(IllegalArgumentException.class, (exception, request, response) -> { response.status(400); response.type(HttpConstants.CONTENT_TYPE_TEXT_PLAIN_UTF8); response.body(exception.getMessage()); }); service.exception(IllegalStateException.class, (exception, request, response) -> { response.status(500); response.type(HttpConstants.CONTENT_TYPE_TEXT_PLAIN_UTF8); response.body(exception.getMessage()); }); initialized = true; }
server.port(port); server.ipAddress(host);
.port(configuration.bindPort());