Skip to content

Commit

Permalink
Merge pull request #5406 from eclipse/jetty-10.0.x-WebSocketSCI
Browse files Browse the repository at this point in the history
throw ISE if the WebSocketSCI configure() is called on a started ServletContextHandler
  • Loading branch information
lachlan-roberts committed Oct 16, 2020
2 parents c95fc2a + 7ed6998 commit 681f46b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ public interface Configurator
*/
public static void configure(ServletContextHandler context, Configurator configurator)
{
if (!context.isStopped())
throw new IllegalStateException("configure should be called before starting");

// In this embedded-jetty usage, allow ServletContext.addListener() to
// add other ServletContextListeners (such as the ContextDestroyListener) after
// the initialization phase is over. (important for this SCI to function)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public interface Configurator
*/
public static void configure(ServletContextHandler context, Configurator configurator)
{
if (!context.isStopped())
throw new IllegalStateException("configure should be called before starting");

context.addEventListener(
ContainerInitializer
.asContextListener(new JettyWebSocketServletContainerInitializer())
Expand Down

0 comments on commit 681f46b

Please sign in to comment.