private HttpServer(final Builder b) throws IOException { this.appDir = b.appDir; this.logDir = b.logDir; final String appDir = getWebAppsPath(b.name); int maxThreads = b.conf.getInt(HTTP_MAX_THREADS, 16); // If HTTP_MAX_THREADS is less than or equal to 0, QueueThreadPool() will use the // default value (currently 200). QueuedThreadPool threadPool = maxThreads <= 0 ? new QueuedThreadPool() : new QueuedThreadPool(maxThreads); threadPool.setDaemon(true); this.webServer = new Server(threadPool); this.adminsAcl = b.adminsAcl; this.webAppContext = createWebAppContext(b.name, b.conf, adminsAcl, appDir); this.findPort = b.findPort; initializeWebServer(b.name, b.hostName, b.conf, b.pathSpecs); }
threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads);
threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads);
private void createWebServer(final Builder b) throws IOException { // Create the thread pool for the web server to handle HTTP requests QueuedThreadPool threadPool = new QueuedThreadPool(); if (b.maxThreads > 0) { threadPool.setMaxThreads(b.maxThreads); } threadPool.setDaemon(true); threadPool.setName(b.name + "-web"); this.webServer = new Server(threadPool); this.appDir = getWebAppsPath(b.name); this.webAppContext = createWebAppContext(b); if (b.useSPNEGO) { // Secure the web server with kerberos setupSpnegoFilter(b); } if (b.enableCORS) { setupCORSFilter(b); } initializeWebServer(b, threadPool.getMaxThreads()); }
threadPool.setDaemon(true); if (maxThreads != -1) { threadPool.setMaxThreads(maxThreads);
threadPool.setDaemon(true);
public RestChangeIngestor() { QueuedThreadPool queuedThreadPool = new QueuedThreadPool(); queuedThreadPool.setDaemon(true); jetty = new Server(queuedThreadPool); }
private QueuedThreadPool createThreadPool(String consumerName, int minThreads, int maxThreads, int keepAliveTimeout) { QueuedThreadPool queuedThreadPool = new QueuedThreadPool(maxThreads, minThreads, keepAliveTimeout * 1000); queuedThreadPool.setName("ESH-httpClient-" + consumerName); queuedThreadPool.setDaemon(true); return queuedThreadPool; }
private static QueuedThreadPool createExecutor(String name, int minThreads, int maxThreads) { try { QueuedThreadPool pool = new QueuedThreadPool(maxThreads, minThreads, 60000, null); pool.setName("http-client-" + name); pool.setDaemon(true); pool.start(); pool.setStopTimeout(2000); return pool; } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }
private static QueuedThreadPool createExecutor(String name, int minThreads, int maxThreads) { try { QueuedThreadPool pool = new QueuedThreadPool(maxThreads, minThreads, 60000, null); pool.setName("http-client-" + name); pool.setDaemon(true); pool.start(); pool.setStopTimeout(2000); pool.setDetailedDump(true); return pool; } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }
private HttpServer(final Builder b) throws IOException { this.appDir = b.appDir; this.logDir = b.logDir; final String appDir = getWebAppsPath(b.name); int maxThreads = b.conf.getInt(HTTP_MAX_THREADS, 16); // If HTTP_MAX_THREADS is less than or equal to 0, QueueThreadPool() will use the // default value (currently 200). QueuedThreadPool threadPool = maxThreads <= 0 ? new QueuedThreadPool() : new QueuedThreadPool(maxThreads); threadPool.setDaemon(true); this.webServer = new Server(threadPool); this.adminsAcl = b.adminsAcl; this.webAppContext = createWebAppContext(b.name, b.conf, adminsAcl, appDir); this.findPort = b.findPort; initializeWebServer(b.name, b.hostName, b.conf, b.pathSpecs); }
private HttpServer(final Builder b) throws IOException { this.appDir = b.appDir; this.logDir = b.logDir; final String appDir = getWebAppsPath(b.name); int maxThreads = b.conf.getInt(HTTP_MAX_THREADS, 16); // If HTTP_MAX_THREADS is less than or equal to 0, QueueThreadPool() will use the // default value (currently 200). QueuedThreadPool threadPool = maxThreads <= 0 ? new QueuedThreadPool() : new QueuedThreadPool(maxThreads); threadPool.setDaemon(true); this.webServer = new Server(threadPool); this.adminsAcl = b.adminsAcl; this.webAppContext = createWebAppContext(b.name, b.conf, adminsAcl, appDir); this.findPort = b.findPort; initializeWebServer(b.name, b.hostName, b.conf, b.pathSpecs); }
threadPool.setDaemon(true); server = new Server(threadPool); server.manage(threadPool);
threadPool.setDaemon(true); this.executor = threadPool; addBean(this.executor);
public JettyHttpServer(URL url, final HttpHandler handler) { super(url, handler); DispatcherServlet.addHttpHandler(url.getPort(), handler); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads); server = new Server(threadPool); // HTTP connector ServerConnector connector = new ServerConnector(server); if (!url.isAnyHost() && NetUtils.isValidLocalHost(url.getHost())) { connector.setHost(url.getHost()); } connector.setPort(url.getPort()); // connector.setIdleTimeout(30000); server.addConnector(connector); ServletHandler servletHandler = new ServletHandler(); ServletHolder servletHolder = servletHandler.addServletWithMapping(DispatcherServlet.class, "/*"); servletHolder.setInitOrder(2); server.insertHandler(servletHandler); try { server.start(); } catch (Exception e) { throw new IllegalStateException("Failed to start jetty server on " + url.getAddress() + ", cause: " + e.getMessage(), e); } }
private void createWebServer(final Builder b) throws IOException { // Create the thread pool for the web server to handle HTTP requests QueuedThreadPool threadPool = new QueuedThreadPool(); if (b.maxThreads > 0) { threadPool.setMaxThreads(b.maxThreads); } threadPool.setDaemon(true); threadPool.setName(b.name + "-web"); this.webServer = new Server(threadPool); this.appDir = getWebAppsPath(b.name); this.webAppContext = createWebAppContext(b); if (b.useSPNEGO) { // Secure the web server with kerberos setupSpnegoFilter(b); } if (b.enableCORS) { setupCORSFilter(b); } initializeWebServer(b, threadPool.getMaxThreads()); }
String name = "WebSocketClient@" + client.hashCode(); threadPool.setName(name); threadPool.setDaemon(true); executor = threadPool;
threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads);
threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads);
pool.setDaemon(true); pool.setName("HttpClient"); _threadPool = pool;