當前位置: 首頁>>代碼示例>>Java>>正文


Java QueuedThreadPool.setDetailedDump方法代碼示例

本文整理匯總了Java中org.eclipse.jetty.util.thread.QueuedThreadPool.setDetailedDump方法的典型用法代碼示例。如果您正苦於以下問題:Java QueuedThreadPool.setDetailedDump方法的具體用法?Java QueuedThreadPool.setDetailedDump怎麽用?Java QueuedThreadPool.setDetailedDump使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jetty.util.thread.QueuedThreadPool的用法示例。


在下文中一共展示了QueuedThreadPool.setDetailedDump方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: newInstance

import org.eclipse.jetty.util.thread.QueuedThreadPool; //導入方法依賴的package包/類
public static void newInstance(String host, int port, int maxThreads, int minThreads, int threadTimeoutMillis) {
    TinyHandler tinyHandler = TinyHandler.get();
    JettyHandler jettyHandler = new JettyHandler(tinyHandler);
    QueuedThreadPool queuedThreadPool = new QueuedThreadPool(minThreads, maxThreads, threadTimeoutMillis);
    queuedThreadPool.setDetailedDump(false);
    Server server = new Server(queuedThreadPool);
    ServerConnector connector = getConnector(server, host, port);
    connector.setAcceptQueueSize(1000);
    server = connector.getServer();
    server.setConnectors(new Connector[]{connector});
    server.setHandler(jettyHandler);
    try {
        server.start();
        server.join();
    } catch (Exception e) {
        e.printStackTrace();
        System.exit(100);
    }
}
 
開發者ID:WhiteBlue,項目名稱:eleme-hackathon,代碼行數:20,代碼來源:JettyServerFactory.java

示例2: configureThreadPool

import org.eclipse.jetty.util.thread.QueuedThreadPool; //導入方法依賴的package包/類
private ThreadPool configureThreadPool(final int port) {
	final QueuedThreadPool threadPool = new QueuedThreadPool(threadPoolCapacity);
	threadPool.setMinThreads(minThreadCount);
	threadPool.setMaxThreads(maxThreadCount);
	threadPool.setName("Jetty thread pool [" + port + "]");
	threadPool.setDetailedDump(true);
	return threadPool;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:9,代碼來源:JettyManager.java

示例3: configureThreadPool

import org.eclipse.jetty.util.thread.QueuedThreadPool; //導入方法依賴的package包/類
protected void configureThreadPool(QueuedThreadPool pool) {
    // override QueuedThreadPool defaults
    pool.setMaxThreads(jettyThreadPoolSettings.getMaxThreads());
    pool.setMinThreads(jettyThreadPoolSettings.getMinThreads());
    pool.setIdleTimeout(jettyThreadPoolSettings.getIdleTimeout());
    pool.setDetailedDump(jettyThreadPoolSettings.isDetailedDump());
}
 
開發者ID:fastnsilver,項目名稱:xlator,代碼行數:8,代碼來源:JettyConfig.java

示例4: EmbeddedJetty

import org.eclipse.jetty.util.thread.QueuedThreadPool; //導入方法依賴的package包/類
public EmbeddedJetty(boolean isDebugMode) {

		ArrayBlockingQueue<Runnable> queue = Queues.newArrayBlockingQueue(this.capability);
		pool = new QueuedThreadPool(this.maxThreads, this.minThreads, this.idleTimeout, queue);
		{
			pool.setName("jetty");
			pool.setDetailedDump(isDebugMode);
			pool.setStopTimeout(this.stopTimeout);
		}

		this.server = new Server(pool);
		this.server.setStopAtShutdown(true);

		// set default error page to empty
		if (false == isDebugMode) {
			this.server.addBean(emtpyErrorPage);
			emtpyErrorPage.setServer(this.server);

			this.server.setDumpAfterStart(false);
			this.server.setDumpBeforeStop(false);
		}

		this.httpConfig = new HttpConfiguration();
		{
			this.httpConfig.setSendServerVersion(false);
			this.httpConfig.setSendXPoweredBy(false);
			this.httpConfig.setSendDateHeader(true);
		}

		this.handlers = new HandlerCollection();
		this.server.setHandler(handlers);
	}
 
開發者ID:dohbot,項目名稱:knives,代碼行數:33,代碼來源:EmbeddedJetty.java

示例5: configureServerPerformance

import org.eclipse.jetty.util.thread.QueuedThreadPool; //導入方法依賴的package包/類
private Server configureServerPerformance(ServerConfig config) {
    // Using thread pool for benchmark - this is not necessarily needed in ordinary setups
    // Normal use is just: 
    // Server server = new Server(PORT);
    QueuedThreadPool pool = new QueuedThreadPool();
    pool.setDetailedDump(false);
    
    
    switch(config.serverPerformance()) {
        case HIGHEST:
            pool.setMaxThreads(Runtime.getRuntime().availableProcessors() * 8);
            pool.setMinThreads(Runtime.getRuntime().availableProcessors() * 8);
            break;
        case HIGH:
            pool.setMaxThreads(Runtime.getRuntime().availableProcessors() * 2);
            pool.setMinThreads(Math.min(Runtime.getRuntime().availableProcessors(), 4));
            break;
        case MEDIUM:
            pool.setMaxThreads(Math.min(Runtime.getRuntime().availableProcessors(), 4));
            pool.setMinThreads(4);
            break;
        case LOW:
            pool.setMaxThreads(4);// A minimum of 4 threads are needed for Jetty to run
            pool.setMinThreads(4);
            break;
        case CUSTOM:
            pool.setMaxThreads(config.ioThreads());
            pool.setMinThreads(config.ioThreads());
            break;
    }
    
    Server server = new Server(pool);
    ServerConnector connector = new ServerConnector(server);
    connector.setAcceptQueueSize(config.backlog());
    connector.setPort(config.port());
    server.setConnectors(new ServerConnector[] {connector});
    
    return server;
}
 
開發者ID:MTDdk,項目名稱:jawn,代碼行數:40,代碼來源:JettyServer.java


注:本文中的org.eclipse.jetty.util.thread.QueuedThreadPool.setDetailedDump方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。