use of com.vaadin.flow.server.communication.PushRequestHandler in project flow by vaadin.
the class VaadinServletService method createRequestHandlers.
@Override
protected List<RequestHandler> createRequestHandlers() throws ServiceException {
List<RequestHandler> handlers = super.createRequestHandlers();
handlers.add(0, new FaviconHandler());
if (isAtmosphereAvailable()) {
try {
handlers.add(new PushRequestHandler(this));
} catch (ServiceException e) {
// Atmosphere init failed. Push won't work but we don't throw a
// service exception as we don't want to prevent non-push
// applications from working
getLogger().warn("Error initializing Atmosphere. Push will not work.", e);
}
}
if (getDeploymentConfiguration().enableDevServer()) {
Optional<DevModeHandler> handlerManager = DevModeHandlerManager.getDevModeHandler(this);
if (handlerManager.isPresent()) {
handlers.add(handlerManager.get());
} else {
getLogger().warn("no DevModeHandlerManager implementation found " + "but dev server enabled. Include the " + "com.vaadin.vaadin-dev-server dependency.");
}
}
addBootstrapHandler(handlers);
return handlers;
}
Aggregations