use of com.haulmont.cuba.web.events.UIRefreshEvent in project cuba by cuba-platform.
the class AppUI method refresh.
@Override
protected void refresh(VaadinRequest request) {
super.refresh(request);
boolean sessionIsAlive = true;
Connection connection = app.getConnection();
if (connection.isAuthenticated()) {
// Ping middleware session if connected
log.debug("Ping middleware session");
try {
UserSession session = connection.getSession();
if (session instanceof ClientUserSession && ((ClientUserSession) session).isAuthenticated()) {
userSessionService.getUserSession(session.getId());
}
} catch (Exception e) {
sessionIsAlive = false;
app.exceptionHandlers.handle(new com.vaadin.server.ErrorEvent(e));
}
if (sessionIsAlive) {
events.publish(new SessionHeartbeatEvent(app));
}
}
if (sessionIsAlive) {
events.publish(new UIRefreshEvent(this));
}
}
Aggregations