jetty-9 ensure injected threadpool is managed

This commit is contained in:
Greg Wilkins 2012-08-03 08:44:49 +10:00
parent 8366ae08c9
commit 962a0d0889
5 changed files with 15 additions and 0 deletions

View File

@ -46,6 +46,7 @@ public class LikeJettyXml
threadPool.setMaxThreads(500);
Server server = new Server(threadPool);
server.manage(threadPool);
server.setDumpAfterStart(true);
server.setDumpBeforeStop(true);

View File

@ -86,6 +86,7 @@ public class StressTest
_threads.setMaxThreads(200);
_server = new Server(_threads);
_server.manage(_threads);
_connector = new SelectChannelConnector(_server,null,null,null,null,1,1);
_connector.setAcceptQueueSize(5000);
_connector.setIdleTimeout(30000);

View File

@ -68,6 +68,17 @@ public class AggregateLifeCycle extends AbstractLifeCycle implements Destroyable
{
for (Bean b:_beans)
{
if (b._bean instanceof LifeCycle)
{
LifeCycle l=(LifeCycle)b._bean;
if (!l.isRunning())
{
if (b._managed)
l.start();
else
LOG.warn("!managed !started {}",b);
}
}
if (b._managed && b._bean instanceof LifeCycle)
{
LifeCycle l=(LifeCycle)b._bean;

View File

@ -161,6 +161,7 @@ public class WebSocketLoadRFC6455Test
QueuedThreadPool threadPool = new QueuedThreadPool(200);
threadPool.setMaxStopTimeMs(1000);
_server = new Server(threadPool);
_server.manage(threadPool);
_connector = new SelectChannelConnector(_server);
_server.addConnector(_connector);

View File

@ -62,6 +62,7 @@ public class TestServer
// Setup server
Server server = new Server(threadPool);
server.manage(threadPool);
server.setSendDateHeader(true);
// Setup JMX