Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-10.0.x-3290-websocket-onOpen
Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
commit
cf0eaecbdc
|
@ -57,6 +57,8 @@ public class WebSocketJsrServer
|
||||||
ServletContextHandler.SESSIONS);
|
ServletContextHandler.SESSIONS);
|
||||||
context.setContextPath("/");
|
context.setContextPath("/");
|
||||||
handlers.addHandler(context);
|
handlers.addHandler(context);
|
||||||
|
handlers.addHandler(new DefaultHandler());
|
||||||
|
server.setHandler(handlers);
|
||||||
|
|
||||||
// Enable javax.websocket configuration for the context
|
// Enable javax.websocket configuration for the context
|
||||||
ServerContainer wsContainer = JavaxWebSocketServletContainerInitializer
|
ServerContainer wsContainer = JavaxWebSocketServletContainerInitializer
|
||||||
|
@ -65,9 +67,6 @@ public class WebSocketJsrServer
|
||||||
// Add your websockets to the container
|
// Add your websockets to the container
|
||||||
wsContainer.addEndpoint(EchoJsrSocket.class);
|
wsContainer.addEndpoint(EchoJsrSocket.class);
|
||||||
|
|
||||||
handlers.addHandler(new DefaultHandler());
|
|
||||||
|
|
||||||
server.setHandler(handlers);
|
|
||||||
server.start();
|
server.start();
|
||||||
context.dumpStdErr();
|
context.dumpStdErr();
|
||||||
server.join();
|
server.join();
|
||||||
|
|
|
@ -83,6 +83,8 @@ public class JavaxWebSocketServerContainer
|
||||||
public static JavaxWebSocketServerContainer ensureContainer(ServletContext servletContext) throws ServletException
|
public static JavaxWebSocketServerContainer ensureContainer(ServletContext servletContext) throws ServletException
|
||||||
{
|
{
|
||||||
ContextHandler contextHandler = ServletContextHandler.getServletContextHandler(servletContext, "Javax Websocket");
|
ContextHandler contextHandler = ServletContextHandler.getServletContextHandler(servletContext, "Javax Websocket");
|
||||||
|
if (contextHandler.getServer() == null)
|
||||||
|
throw new IllegalStateException("Server has not been set on the ServletContextHandler");
|
||||||
|
|
||||||
JavaxWebSocketServerContainer container = contextHandler.getBean(JavaxWebSocketServerContainer.class);
|
JavaxWebSocketServerContainer container = contextHandler.getBean(JavaxWebSocketServerContainer.class);
|
||||||
if (container==null)
|
if (container==null)
|
||||||
|
@ -95,8 +97,7 @@ public class JavaxWebSocketServerContainer
|
||||||
|
|
||||||
Executor executor = httpClient == null?null:httpClient.getExecutor();
|
Executor executor = httpClient == null?null:httpClient.getExecutor();
|
||||||
if (executor == null)
|
if (executor == null)
|
||||||
executor = (Executor)servletContext
|
executor = (Executor)servletContext.getAttribute("org.eclipse.jetty.server.Executor");
|
||||||
.getAttribute("org.eclipse.jetty.server.Executor");
|
|
||||||
if (executor == null)
|
if (executor == null)
|
||||||
executor = contextHandler.getServer().getThreadPool();
|
executor = contextHandler.getServer().getThreadPool();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue