@Override public void run() { accessSynchronously(runnable); }
/** * Removes those UIs from the given session for which {@link UI#isClosing() * isClosing} yields true. * * @param session */ private void removeClosedUIs(final VaadinSession session) { List<UI> uis = new ArrayList<>(session.getUIs()); for (final UI ui : uis) { if (ui.isClosing()) { ui.accessSynchronously(() -> { getLogger().log(Level.FINER, "Removing closed UI {0}", ui.getUIId()); session.removeUI(ui); }); } } }
/** * Closes those UIs in the given session for which {@link #isUIActive} * yields false. * * @since 7.0.0 */ private void closeInactiveUIs(VaadinSession session) { final String sessionId = session.getSession().getId(); for (final UI ui : session.getUIs()) { if (!isUIActive(ui) && !ui.isClosing()) { ui.accessSynchronously(() -> { getLogger().log(Level.FINE, "Closing inactive UI #{0} in session {1}", new Object[] { ui.getUIId(), sessionId }); ui.close(); }); } } }
@Override public void accessSynchronously(Runnable runnable) { ui.accessSynchronously(runnable); } }
@Override public void execute() { accessSynchronously(command); }
/** * Removes those UIs from the given session for which {@link UI#isClosing() * isClosing} yields true. * * @param session */ private void removeClosedUIs(final VaadinSession session) { ArrayList<UI> uis = new ArrayList<>(session.getUIs()); for (final UI ui : uis) { if (ui.isClosing()) { ui.accessSynchronously(new Command() { @Override public void execute() { getLogger().log(Level.FINER, "Removing closed UI {0}", ui.getUIId()); session.removeUI(ui); } }); } } }
/** * Closes those UIs in the given session for which {@link #isUIActive} * yields false. * * @since 7.0.0 */ private void closeInactiveUIs(VaadinSession session) { final String sessionId = session.getSession().getId(); for (final UI ui : session.getUIs()) { if (!isUIActive(ui) && !ui.isClosing()) { ui.accessSynchronously(new Command() { @Override public void execute() { getLogger().log(Level.FINE, "Closing inactive UI #{0} in session {1}", new Object[] { ui.getUIId(), sessionId }); ui.close(); } }); } } }
ui.accessSynchronously(new Command() { @Override public void execute() {
.withNumberOfRequests(pingRequest.getNumberRequests()) .withProgressCallback((newSequence, summary) -> { getUI().accessSynchronously(() -> { if (pingFuture != null && !pingFuture.isCancelled()) { setRunning(!summary.isComplete());
.withNumberOfRequests(pingRequest.getNumberRequests()) .withProgressCallback((newSequence, summary) -> { getUI().accessSynchronously(() -> { if (pingFuture != null && !pingFuture.isCancelled()) { setRunning(!summary.isComplete());