@AfterClass public static void teardown() { httpServer.shutdown(); }
public void run() { int port = config.getProperty("port") != null ? Integer.parseInt(config.getProperty("port")) : DEFAULT_PORT; String addr = config.getProperty("bind-address") != null ? config.getProperty("bind-address") : DEFAULT_BIND_ADDRESS; LOG.info("Starting analyst broker on port {} of interface {}", port, addr); HttpServer httpServer = new HttpServer(); NetworkListener networkListener = new NetworkListener("broker", addr, port); // We avoid blocking IO, and the following line allows us to see closed connections. networkListener.getTransport().setIOStrategy(SameThreadIOStrategy.getInstance()); httpServer.addListener(networkListener); // Bypass Jersey etc. and add a low-level Grizzly handler. // As in servlets, * is needed in base path to identify the "rest" of the path. broker = new Broker(config, addr, port); httpServer.getServerConfiguration().addHttpHandler(new BrokerHttpHandler(broker), "/*"); try { httpServer.start(); LOG.info("Broker running."); broker.run(); // run queue broker task pump in this thread Thread.currentThread().join(); } catch (BindException be) { LOG.error("Cannot bind to port {}. Is it already in use?", port); } catch (IOException ioe) { LOG.error("IO exception while starting server."); } catch (InterruptedException ie) { LOG.info("Interrupted, shutting down."); } httpServer.shutdown(); }
httpServer.shutdown();
LOG.log(Level.SEVERE, "An error occurred during test data generation. ", e); server.shutdown();
server.shutdown();
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * Stops the HTTP server. */ public static void stopServer() { if (server != null) { server.shutdown(); } }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
/** * <p> * Gracefully shuts down the <code>HttpServer</code> instance. * </p> */ public synchronized GrizzlyFuture<HttpServer> shutdown() { return shutdown(-1, TimeUnit.MILLISECONDS); }
public void shutdown() { log.info("Starting rest service shutdown"); //TODO configure server.shutdown(1, TimeUnit.SECONDS); } }
@Override public void stop() { LOGGER.info("Stopping Jersey server at {}", uri); if (influxConfig != null) { this.executor.shutdown(); } if (Objects.nonNull(this.server)) { this.server.shutdown(); } LOGGER.info("Stopped Jersey server at {}", uri); }
@Override public void stop(ServerInstance<HttpServer> serverInstance) { if (serverInstance != null) { serverInstance.command((httpServer, baseURI) -> { httpServer.shutdown(); }); } }
/** * Stop. */ public synchronized void stop() { for (HttpServer server : serverList) { server.shutdown(); } LensServices.get().stop(); printShutdownMessage(); }