private void createThreadPool() { final int maxThreads = this.props .getInt("jetty.maxThreads", Constants.DEFAULT_JETTY_MAX_THREAD_COUNT); final QueuedThreadPool httpThreadPool = new QueuedThreadPool(maxThreads); this.server.setThreadPool(httpThreadPool); addThreadPoolGauges(httpThreadPool); }
Server httpServer = new Server(); httpServer.setConnectors(new Connector[] { connector }); httpServer.setThreadPool(threadPool); httpServer.setSendServerVersion(false); httpServer.setSendDateHeader(false);
: new QueuedThreadPool(maxThreads); threadPool.setDaemon(true); webServer.setThreadPool(threadPool);
webServer.setThreadPool(threadPool);
webServer.setThreadPool(threadPool);
webServer.addConnector(listener); webServer.setThreadPool(new QueuedThreadPool());
webServer.addConnector(listener); webServer.setThreadPool(new QueuedThreadPool());
agentServer.setThreadPool( new QueuedThreadPool( configsMap.getOptionInt("agent.threadpool.size.max", 25)));
server.setThreadPool(httpThreadPool);
/** * Constructor. * * @param server * The server to help. */ public JettyServerHelper(org.restlet.Server server) { super(server); this.connector = null; this.wrappedServer = new WrappedServer(this); // Configuring the thread pool final QueuedThreadPool btp = new QueuedThreadPool(); btp.setLowThreads(getLowThreads()); btp.setMaxIdleTimeMs(getThreadMaxIdleTimeMs()); btp.setMaxThreads(getMaxThreads()); btp.setMinThreads(getMinThreads()); getWrappedServer().setThreadPool(btp); }
threadPool.setMinThreads(getMinThreadPoolSize()); threadPool.setMaxThreads(getMaxThreadPoolSize()); m_server.setThreadPool(threadPool); threadPool.setMaxThreads(getMaxThreadPoolSize()); threadPool.setSpawnOrShrinkAt(getMinThreadPoolSize()); m_server.setThreadPool(threadPool);
qtp.setName("llama-jetty"); qtp.setDaemon(true); httpServer.setThreadPool(qtp); String strAddress = getServerConf().getHttpAddress(); InetSocketAddress address = NetUtils.createSocketAddr(strAddress,
webServer.setThreadPool(threadPool);
@Override protected void startUp() throws Exception { // setup the jetty config ServletHolder sh = new ServletHolder(ServletContainer.class); sh.setInitParameter("com.sun.jersey.config.property.packages", "com.twitter.hraven.rest"); sh.setInitParameter(JSONConfiguration.FEATURE_POJO_MAPPING, "true"); server = new Server(); Connector connector = new SelectChannelConnector(); connector.setPort(this.port); connector.setHost(address); server.addConnector(connector); // TODO: in the future we may want to provide settings for the min and max threads // Jetty sets the default max thread number to 250, if we don't set it. // QueuedThreadPool threadPool = new QueuedThreadPool(); server.setThreadPool(threadPool); server.setSendServerVersion(false); server.setSendDateHeader(false); server.setStopAtShutdown(true); // set up context Context context = new Context(server, "/", Context.SESSIONS); context.addServlet(sh, "/*"); // start server server.start(); }
@Override protected void startUp() throws Exception { // setup the jetty config ServletHolder sh = new ServletHolder(ServletContainer.class); sh.setInitParameter("com.sun.jersey.config.property.packages", "com.twitter.hraven.rest"); sh.setInitParameter(JSONConfiguration.FEATURE_POJO_MAPPING, "true"); server = new Server(); Connector connector = new SelectChannelConnector(); connector.setPort(this.port); connector.setHost(address); server.addConnector(connector); // TODO: in the future we may want to provide settings for the min and max threads // Jetty sets the default max thread number to 250, if we don't set it. // QueuedThreadPool threadPool = new QueuedThreadPool(); server.setThreadPool(threadPool); server.setSendServerVersion(false); server.setSendDateHeader(false); server.setStopAtShutdown(true); // set up context Context context = new Context(server, "/", Context.SESSIONS); context.addServlet(sh, "/*"); // start server server.start(); }
server.setThreadPool(threadPool); server.addConnector(connector);
server.setThreadPool(threadPool); server.addConnector(connector);
server.setThreadPool(threadPool); server.addConnector(connector);
server.setThreadPool(threadPool); server.addConnector(connector);
server.setThreadPool(threadPool); server.addConnector(connector);