Example usage for com.vaadin.server.communication ServletUIInitHandler ServletUIInitHandler

List of usage examples for com.vaadin.server.communication ServletUIInitHandler ServletUIInitHandler

Introduction

In this page you can find the example usage for com.vaadin.server.communication ServletUIInitHandler ServletUIInitHandler.

Prototype

ServletUIInitHandler

Source Link

Usage

From source file:com.github.mcollovati.vertx.vaadin.VertxVaadinService.java

License:Open Source License

@Override
protected List<RequestHandler> createRequestHandlers() throws ServiceException {
    List<RequestHandler> handlers = super.createRequestHandlers();
    handlers.add(0, new ServletBootstrapHandler());
    handlers.add(new ServletUIInitHandler());
    if (isAtmosphereAvailable()) {
        handlers.add((RequestHandler) (session, request, response) -> {
            if (!ServletPortletHelper.isPushRequest(request)) {
                return false;
            }/* w  w w  . ja  va 2s .  c o m*/
            if (request instanceof VertxVaadinRequest) {
                ((VertxVaadinRequest) request).getRoutingContext().next();
            }
            return true;
        });
    }
    return handlers;
}