Merge pull request #5406 from eclipse/jetty-10.0.x-WebSocketSCI
throw ISE if the WebSocketSCI configure() is called on a started ServletContextHandler
This commit is contained in:
commit
681f46bd2a
|
@ -99,6 +99,9 @@ public class JavaxWebSocketServletContainerInitializer implements ServletContain
|
|||
*/
|
||||
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)
|
||||
|
|
|
@ -53,6 +53,9 @@ public class JettyWebSocketServletContainerInitializer implements ServletContain
|
|||
*/
|
||||
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())
|
||||
|
|
Loading…
Reference in New Issue