Unmanage beans on WSSComponents if they are also beans on server.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
b51e40892d
commit
16b014c2fb
|
@ -83,11 +83,11 @@ public class WebSocketServerComponents extends WebSocketComponents
|
|||
|
||||
// These components may be managed by the server but not yet started.
|
||||
// In this case we don't want them to be managed by the components as well.
|
||||
if (server.isManaged(inflaterPool))
|
||||
if (server.contains(inflaterPool))
|
||||
serverComponents.unmanage(inflaterPool);
|
||||
if (server.isManaged(deflaterPool))
|
||||
if (server.contains(deflaterPool))
|
||||
serverComponents.unmanage(deflaterPool);
|
||||
if (server.isManaged(bufferPool))
|
||||
if (server.contains(bufferPool))
|
||||
serverComponents.unmanage(bufferPool);
|
||||
|
||||
servletContext.setAttribute(WEBSOCKET_COMPONENTS_ATTRIBUTE, serverComponents);
|
||||
|
|
|
@ -124,8 +124,8 @@ public class WebSocketServerComponentsTest
|
|||
// Use a custom InflaterPool and DeflaterPool that are not started or managed.
|
||||
InflaterPool inflaterPool = new InflaterPool(333, false);
|
||||
DeflaterPool deflaterPool = new DeflaterPool(333, Deflater.BEST_SPEED, false);
|
||||
server.addManaged(inflaterPool);
|
||||
server.addManaged(deflaterPool);
|
||||
server.addBean(inflaterPool);
|
||||
server.addBean(deflaterPool);
|
||||
|
||||
// ensureWebSocketComponents can only be called when the server is starting.
|
||||
contextHandler.addServletContainerInitializer(new ServletContainerInitializerHolder((c, ctx) ->
|
||||
|
|
Loading…
Reference in New Issue