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(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, newAtmosphereFramework
getLastModified, service, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
public void init(ServletConfig sc) throws ServletException
init
in interface Servlet
init
in class AtmosphereServlet
ServletException
protected 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–2016. All rights reserved.