From 52a8101cd254c34404986f3db6f135eeb7cea631 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 13 Oct 2016 14:41:53 -0700 Subject: [PATCH] Issue #207 - ensuring WebSocketServerFactory init occurs earlier --- .../server/deploy/WebSocketServerContainerInitializer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java index f072cd864f1..10ff77af90f 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java +++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java @@ -98,6 +98,7 @@ public class WebSocketServerContainerInitializer implements ServletContainerInit { // Create Filter WebSocketUpgradeFilter filter = WebSocketUpgradeFilter.configureContext(context); + filter.getFactory().init(context); // Create the Jetty ServerContainer implementation ServerContainer jettyContainer = new ServerContainer(filter,filter.getFactory(),context.getServer().getThreadPool()); @@ -123,6 +124,7 @@ public class WebSocketServerContainerInitializer implements ServletContainerInit { // Create Filter WebSocketUpgradeFilter filter = WebSocketUpgradeFilter.configureContext(context); + filter.getFactory().init(context); // Create the Jetty ServerContainer implementation ServerContainer jettyContainer = new ServerContainer(filter,filter.getFactory(),jettyContext.getServer().getThreadPool()); @@ -247,8 +249,7 @@ public class WebSocketServerContainerInitializer implements ServletContainerInit { // Create the Jetty ServerContainer implementation ServerContainer jettyContainer = configureContext(context,jettyContext); - - context.addListener(new ContextDestroyListener()); //make sure context is cleaned up when the context stops + context.addListener(new ContextDestroyListener()); // make sure context is cleaned up when the context stops // // Establish the DecoratedObjectFactory thread local // // for various ServiceLoader initiated components to use.