Add name on WebSocketComponents default threadpool
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
316c46675e
commit
edec52893b
|
@ -57,7 +57,17 @@ public class WebSocketComponents extends ContainerLifeCycle
|
|||
_bufferPool = (bufferPool == null) ? new MappedByteBufferPool() : bufferPool;
|
||||
_inflaterPool = (inflaterPool == null) ? new InflaterPool(CompressionPool.DEFAULT_CAPACITY, true) : inflaterPool;
|
||||
_deflaterPool = (deflaterPool == null) ? new DeflaterPool(CompressionPool.DEFAULT_CAPACITY, Deflater.DEFAULT_COMPRESSION, true) : deflaterPool;
|
||||
_executor = (executor == null) ? new QueuedThreadPool() : executor;
|
||||
|
||||
if (executor == null)
|
||||
{
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool();
|
||||
threadPool.setName("WebSocket@" + hashCode());
|
||||
_executor = threadPool;
|
||||
}
|
||||
else
|
||||
{
|
||||
_executor = executor;
|
||||
}
|
||||
|
||||
addBean(_inflaterPool);
|
||||
addBean(_deflaterPool);
|
||||
|
|
|
@ -85,10 +85,6 @@ public class WebSocketClient extends ContainerLifeCycle implements WebSocketPoli
|
|||
{
|
||||
coreClient = new WebSocketCoreClient(httpClient, components);
|
||||
addManaged(coreClient);
|
||||
|
||||
if (httpClient == null)
|
||||
coreClient.getHttpClient().setName("Jetty-WebSocketClient@" + hashCode());
|
||||
|
||||
frameHandlerFactory = new JettyWebSocketFrameHandlerFactory(this, components);
|
||||
sessionListeners.add(sessionTracker);
|
||||
addBean(sessionTracker);
|
||||
|
|
|
@ -41,7 +41,7 @@ public class HttpClientInitTest
|
|||
assertThat("Executor exists", executor, notNullValue());
|
||||
assertThat("Executor instanceof", executor, instanceOf(QueuedThreadPool.class));
|
||||
QueuedThreadPool threadPool = (QueuedThreadPool)executor;
|
||||
assertThat("QueuedThreadPool.name", threadPool.getName(), startsWith("WebSocketClient@"));
|
||||
assertThat("QueuedThreadPool.name", threadPool.getName(), startsWith("WebSocket@"));
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue