public class AsityAtmosphereServlet extends AtmosphereServlet
AtmosphereResource into ServerHttpExchange
and ServerWebSocket. When you configure servlet, you must set
asyncSupported to true
and set a init param,
org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults
, to true.
Servlet servlet = new AsityAtmosphereServlet().onhttp(http -> {}).onwebsocket(ws -> {});
ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName(),
servlet);
reg.setAsyncSupported(true);
reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE
.toString())
reg.addMapping("/cettia");
initializer, logger| Constructor and Description |
|---|
AsityAtmosphereServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(javax.servlet.ServletConfig sc) |
protected boolean |
isWebSocketResource(AtmosphereResource resource)
Does the given
AtmosphereResource represent WebSocket resource? |
AsityAtmosphereServlet |
onhttp(Action<ServerHttpExchange> action)
Registers an action to be called when
ServerHttpExchange is
available. |
AsityAtmosphereServlet |
onwebsocket(Action<ServerWebSocket> action)
Registers an action to be called when
ServerWebSocket is
available. |
configureFramework, configureFramework, destroy, doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, framework, newAtmosphereFrameworkpublic void init(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class AtmosphereServletjavax.servlet.ServletExceptionprotected boolean isWebSocketResource(AtmosphereResource resource)
AtmosphereResource represent WebSocket resource?public AsityAtmosphereServlet onhttp(Action<ServerHttpExchange> action)
ServerHttpExchange is
available.public AsityAtmosphereServlet onwebsocket(Action<ServerWebSocket> action)
ServerWebSocket is
available.Copyright © 2015–2018. All rights reserved.