本文整理了Java中org.eclipse.jetty.server.Server.setThreadPool()
方法的一些代码示例,展示了Server.setThreadPool()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.setThreadPool()
方法的具体详情如下:
包路径:org.eclipse.jetty.server.Server
类名称:Server
方法名:setThreadPool
暂无
代码示例来源:origin: 4thline/cling
@Override
synchronized public void setExecutorService(ExecutorService executorService) {
if (INSTANCE.server.getThreadPool() == null) {
INSTANCE.server.setThreadPool(new ExecutorThreadPool(executorService) {
@Override
protected void doStop() throws Exception {
// Do nothing, don't shut down the Cling ExecutorService when Jetty stops!
}
});
}
}
代码示例来源:origin: stackoverflow.com
Server server = new Server();
LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(maxQueueSize);
ExecutorThreadPool pool = new ExecutorThreadPool(minThreads, maxThreads, maxIdleTime, TimeUnit.MILLISECONDS, queue);
server.setThreadPool(pool);
代码示例来源:origin: kingthy/TVRemoteIME
@Override
synchronized public void setExecutorService(ExecutorService executorService) {
if (INSTANCE.server.getThreadPool() == null) {
INSTANCE.server.setThreadPool(new ExecutorThreadPool(executorService) {
@Override
protected void doStop() throws Exception {
// Do nothing, don't shut down the Cling ExecutorService when Jetty stops!
}
});
}
}
代码示例来源:origin: org.fourthline.cling/cling-core
@Override
synchronized public void setExecutorService(ExecutorService executorService) {
if (INSTANCE.server.getThreadPool() == null) {
INSTANCE.server.setThreadPool(new ExecutorThreadPool(executorService) {
@Override
protected void doStop() throws Exception {
// Do nothing, don't shut down the Cling ExecutorService when Jetty stops!
}
});
}
}
代码示例来源:origin: steveliles/jetty-embedded-spring-mvc-noxml
public void start() throws Exception
{
server = new Server();
server.setThreadPool(createThreadPool());
server.addConnector(createConnector());
server.setHandler(createHandlers());
server.setStopAtShutdown(true);
server.start();
}
代码示例来源:origin: fjfd/microscope
public void start() throws Exception {
server = new Server();
server.setThreadPool(createThreadPool());
server.addConnector(createConnector());
server.setHandler(createHandlers());
server.setStopAtShutdown(true);
server.start();
}
代码示例来源:origin: restx/restx
@Override
protected void _start() throws Exception {
server = new Server();
server.setThreadPool(createThreadPool());
server.addConnector(createConnector());
server.setHandler(createHandlers(createContext()));
server.setStopAtShutdown(true);
server.start();
}
代码示例来源:origin: restx/restx
@Override
protected void _start() throws Exception {
server = new Server();
server.setThreadPool(createThreadPool());
server.addConnector(createConnector());
server.setHandler(createHandlers(createContext()));
server.setStopAtShutdown(true);
server.start();
}
代码示例来源:origin: io.restx/restx-server-jetty8
@Override
protected void _start() throws Exception {
server = new Server();
server.setThreadPool(createThreadPool());
server.addConnector(createConnector());
server.setHandler(createHandlers(createContext()));
server.setStopAtShutdown(true);
server.start();
}
代码示例来源:origin: io.restx/restx-server-jetty7
@Override
protected void _start() throws Exception {
server = new Server();
server.setThreadPool(createThreadPool());
server.addConnector(createConnector());
server.setHandler(createHandlers(createContext()));
server.setStopAtShutdown(true);
server.start();
}
代码示例来源:origin: org.jmockring/jmockring-jetty
/**
* Start Up the server
*/
private void startServer() {
Server srv = new Server();
srv.setStopAtShutdown(true);
srv.setGracefulShutdown(5000);
QueuedThreadPool threadPool = new QueuedThreadPool();
threadPool.setMaxThreads(Integer.valueOf(configuration.getProperties().getProperty("jetty.threads.max", "250")));
srv.setThreadPool(threadPool);
Connector connector = new SelectChannelConnector();
connector.setPort(port);
connector.setMaxIdleTime(30000);
srv.setConnectors(new Connector[]{connector});
try {
List<ServletContextHandler> contexts = initialiseAndCreateContexts();
HandlerCollection handlerCollection = getHandlerCollection(srv, contexts);
srv.setHandler(handlerCollection);
srv.start();
srv.join();
} catch (Exception e) {
log.error("Exception: ", e);
e.printStackTrace();
}
}
代码示例来源:origin: com.ning.jetty/ning-service-skeleton-core
private void configureThreadPool(final CoreConfig config)
{
final QueuedThreadPool threadPool = new QueuedThreadPool(config.getMaxThreads());
threadPool.setMinThreads(config.getMinThreads());
threadPool.setName("http-worker");
server.setThreadPool(threadPool);
}
代码示例来源:origin: org.tachyonproject/tachyon-servers
mServer.setThreadPool(threadPool);
代码示例来源:origin: com.azaptree/azaptree-http-service
private void configureServer(final HttpServiceConfig config) {
server.addConnector(createSelectChannelConnector(config));
server.setThreadPool(new ExecutorThreadPoolWithGracefulShutdown(config.getRequestExcecutor(), config.getGracefulShutdownTimeoutSecs()));
if (config.getGracefulShutdownTimeoutSecs() > 0) {
server.setGracefulShutdown(1);
}
final HandlerList handlerList = new HandlerList();
handlerList.setHandlers(new Handler[] { config.getHttpRequestHandler(), new DefaultHandler() });
server.setHandler(handlerList);
server.setDumpAfterStart(true);
server.setDumpBeforeStop(true);
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jetty
/**
* Returns the wrapped Jetty server.
*
* @return The wrapped Jetty server.
*/
protected Server getWrappedServer() {
if (this.wrappedServer == null) {
this.wrappedServer = new WrappedServer(this);
// Configuring the thread pool
QueuedThreadPool btp = new QueuedThreadPool();
btp.setMaxIdleTimeMs(getThreadMaxIdleTimeMs());
btp.setMaxThreads(getMaxThreads());
btp.setMinThreads(getMinThreads());
getWrappedServer().setThreadPool(btp);
if (getGracefulShutdown() > 0) {
getWrappedServer().setGracefulShutdown(getGracefulShutdown());
}
}
return this.wrappedServer;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
setThreadPool(new QueuedThreadPool());
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
setThreadPool(new QueuedThreadPool());
代码示例来源:origin: org.eclipse.jetty/server
setThreadPool(new QueuedThreadPool());
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
setThreadPool(new QueuedThreadPool());
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
aconn.getServer().setThreadPool(pool);
aconn.setThreadPool(pool);
内容来源于网络,如有侵权,请联系作者删除!