Initial reactive, WebSocket Tomcat support
Issue: SPR-14527
This commit is contained in:
committed by
Rossen Stoyanchev
parent
41ece612cf
commit
46b39f4372
@@ -37,6 +37,8 @@ public class TomcatHttpServer extends HttpServerSupport implements HttpServer, I
|
||||
|
||||
private String baseDir;
|
||||
|
||||
private Class<?> wsListener;
|
||||
|
||||
|
||||
public TomcatHttpServer() {
|
||||
}
|
||||
@@ -45,6 +47,11 @@ public class TomcatHttpServer extends HttpServerSupport implements HttpServer, I
|
||||
this.baseDir = baseDir;
|
||||
}
|
||||
|
||||
public TomcatHttpServer(String baseDir, Class<?> wsListener) {
|
||||
this.baseDir = baseDir;
|
||||
this.wsListener = wsListener;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
@@ -61,6 +68,9 @@ public class TomcatHttpServer extends HttpServerSupport implements HttpServer, I
|
||||
Context rootContext = tomcatServer.addContext("", base.getAbsolutePath());
|
||||
Tomcat.addServlet(rootContext, "httpHandlerServlet", servlet);
|
||||
rootContext.addServletMappingDecoded("/", "httpHandlerServlet");
|
||||
if (wsListener != null) {
|
||||
rootContext.addApplicationListener(wsListener.getName());
|
||||
}
|
||||
}
|
||||
|
||||
private ServletHttpHandlerAdapter initServletHttpHandlerAdapter() {
|
||||
|
||||
Reference in New Issue
Block a user