public abstract class VibeAtmosphereServlet 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.
ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), new VibeAtmosphereServlet() {
@Override
protected Action<ServerHttpExchange> httpAction() {
return server.httpAction();
}
@Override
protected Action<ServerWebSocket> wsAction() {
return server.wsAction();
}
});
reg.setAsyncSupported(true);
reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString())
reg.addMapping("/vibe");
autoDetectHandlers, framework, isFilter, logger| Constructor and Description |
|---|
VibeAtmosphereServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Action<ServerHttpExchange> |
httpAction()
An
Action to consume ServerHttpExchange. |
void |
init(ServletConfig sc) |
protected boolean |
isWebSocketResource(AtmosphereResource resource)
Does the given
AtmosphereResource represent WebSocket resource? |
protected abstract Action<ServerWebSocket> |
wsAction()
An
Action to consume ServerWebSocket. |
configureFramework, destroy, doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, framework, newAtmosphereFrameworkgetLastModified, service, servicegetInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, logpublic void init(ServletConfig sc) throws ServletException
init in interface Servletinit in class AtmosphereServletServletExceptionprotected boolean isWebSocketResource(AtmosphereResource resource)
AtmosphereResource represent WebSocket resource?protected abstract Action<ServerHttpExchange> httpAction()
Action to consume ServerHttpExchange.protected abstract Action<ServerWebSocket> wsAction()
Action to consume ServerWebSocket.Copyright 2014, The Vibe Project