use of com.haulmont.cuba.web.App in project cuba by cuba-platform.
the class ExceptionDialog method forceLogout.
protected void forceLogout() {
App app = AppUI.getCurrent().getApp();
final WebWindowManager wm = app.getWindowManager();
try {
Connection connection = wm.getApp().getConnection();
if (connection.isConnected()) {
connection.logout();
}
} catch (Exception e) {
log.warn("Exception on forced logout", e);
} finally {
// always restart UI
String url = ControllerUtils.getLocationWithoutParams() + "?restartApp";
Page.getCurrent().open(url, "_self");
}
}
use of com.haulmont.cuba.web.App in project cuba by cuba-platform.
the class NoUserSessionHandler method doHandle.
@Override
protected void doHandle(App app, String className, String message, @Nullable Throwable throwable) {
try {
// we may show two or more dialogs if user pressed F5 and we have no valid user session
// just remove previous dialog and show new
List<Window> noUserSessionDialogs = app.getAppUI().getWindows().stream().filter(w -> w instanceof NoUserSessionExceptionDialog).collect(Collectors.toList());
for (Window dialog : noUserSessionDialogs) {
app.getAppUI().removeWindow(dialog);
}
showNoUserSessionDialog(app);
} catch (Throwable th) {
log.error("Unable to handle NoUserSessionException", throwable);
log.error("Exception in NoUserSessionHandler", th);
}
}
Aggregations