本文整理了Java中org.mortbay.jetty.Server.setThreadPool()
方法的一些代码示例,展示了Server.setThreadPool()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.setThreadPool()
方法的具体详情如下:
包路径:org.mortbay.jetty.Server
类名称:Server
方法名:setThreadPool
暂无
代码示例来源:origin: azkaban/azkaban
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);
}
代码示例来源:origin: voldemort/voldemort
Server httpServer = new Server();
httpServer.setConnectors(new Connector[] { connector });
httpServer.setThreadPool(threadPool);
httpServer.setSendServerVersion(false);
httpServer.setSendDateHeader(false);
代码示例来源:origin: io.hops/hadoop-common
: new QueuedThreadPool(maxThreads);
threadPool.setDaemon(true);
webServer.setThreadPool(threadPool);
代码示例来源:origin: org.apache.tajo/tajo-core
webServer.setThreadPool(threadPool);
代码示例来源:origin: apache/tajo
webServer.setThreadPool(threadPool);
代码示例来源:origin: org.apache.hama/hama-core
webServer.addConnector(listener);
webServer.setThreadPool(new QueuedThreadPool());
代码示例来源:origin: apache/hama
webServer.addConnector(listener);
webServer.setThreadPool(new QueuedThreadPool());
代码示例来源:origin: apache/incubator-slider
agentServer.setThreadPool(
new QueuedThreadPool(
configsMap.getOptionInt("agent.threadpool.size.max", 25)));
代码示例来源:origin: com.linkedin.azkaban/azkaban
server.setThreadPool(httpThreadPool);
代码示例来源:origin: org.restlet/org.restlet.ext.jetty
/**
* 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);
}
代码示例来源:origin: com.ebay.jetstream/jetstreamcore
threadPool.setMinThreads(getMinThreadPoolSize());
threadPool.setMaxThreads(getMaxThreadPoolSize());
m_server.setThreadPool(threadPool);
threadPool.setMaxThreads(getMaxThreadPoolSize());
threadPool.setSpawnOrShrinkAt(getMinThreadPoolSize());
m_server.setThreadPool(threadPool);
代码示例来源:origin: com.cloudera.llama/llama
qtp.setName("llama-jetty");
qtp.setDaemon(true);
httpServer.setThreadPool(qtp);
String strAddress = getServerConf().getHttpAddress();
InetSocketAddress address = NetUtils.createSocketAddr(strAddress,
代码示例来源:origin: com.facebook.hadoop/hadoop-core
webServer.setThreadPool(threadPool);
代码示例来源:origin: com.twitter.hraven/hraven-core
@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();
}
代码示例来源:origin: twitter/hraven
@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();
}
代码示例来源:origin: remoting/dubbox
server.setThreadPool(threadPool);
server.addConnector(connector);
代码示例来源:origin: net.jahhan/dubbo-remoting-http
server.setThreadPool(threadPool);
server.addConnector(connector);
代码示例来源:origin: remoting/dubbox
server.setThreadPool(threadPool);
server.addConnector(connector);
代码示例来源:origin: com.alibaba/dubbo-remoting-http
server.setThreadPool(threadPool);
server.addConnector(connector);
代码示例来源:origin: com.alibaba/dubbo
server.setThreadPool(threadPool);
server.addConnector(connector);
内容来源于网络,如有侵权,请联系作者删除!