com.vaadin.flow.server.ServiceInitEvent

Here are the examples of the java api com.vaadin.flow.server.ServiceInitEvent taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 Source : ConfigureUIServiceInitListener.java
with The Unlicense
from vaadin-learning-center

@Override
public void serviceInit(ServiceInitEvent event) {
    event.getSource().addUIInitListener(uiEvent -> {
        final UI ui = uiEvent.getUI();
        ui.addBeforeEnterListener(this::beforeEnter);
    });
}

19 Source : TestingServiceInitListener.java
with MIT License
from mcollovati

@Override
public void serviceInit(ServiceInitEvent event) {
    event.getSource().addUIInitListener(this::handleUIInit);
    initCount.incrementAndGet();
    RouteConfiguration configuration = RouteConfiguration.forRegistry(ApplicationRouteRegistry.getInstance(((VertxVaadinService) event.getSource()).getServletContext()));
    if (!configuration.isPathRegistered(DYNAMICALLY_REGISTERED_ROUTE)) {
        configuration.setRoute(DYNAMICALLY_REGISTERED_ROUTE, DynamicallyRegisteredRoute.clreplaced);
    }
    event.addRequestHandler((session, request, response) -> {
        requestCount.incrementAndGet();
        return false;
    });
}