try {
atmosphere.init(service.getServlet().getServletConfig());
// Ensure the client-side knows how to split the message stream
// into individual messages when using certain transports
AtmosphereInterceptor trackMessageSize = new TrackMessageSizeInterceptor();
trackMessageSize.configure(atmosphere.getAtmosphereConfig());
atmosphere.interceptor(trackMessageSize);
} catch (ServletException e) {
throw new ServiceException("Could not read atmosphere settings", e);
}
}