Search in sources :

Example 1 with PushRequestHandler

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;
}
Also used : IndexHtmlRequestHandler(com.vaadin.flow.server.communication.IndexHtmlRequestHandler) PushRequestHandler(com.vaadin.flow.server.communication.PushRequestHandler) FaviconHandler(com.vaadin.flow.server.communication.FaviconHandler) PushRequestHandler(com.vaadin.flow.server.communication.PushRequestHandler) DevModeHandler(com.vaadin.flow.internal.DevModeHandler)

Aggregations

DevModeHandler (com.vaadin.flow.internal.DevModeHandler)1 FaviconHandler (com.vaadin.flow.server.communication.FaviconHandler)1 IndexHtmlRequestHandler (com.vaadin.flow.server.communication.IndexHtmlRequestHandler)1 PushRequestHandler (com.vaadin.flow.server.communication.PushRequestHandler)1