/** * Enables push if push support is available and push has not yet been * enabled. * * If push support is not available, a warning explaining the situation will * be logged at least the first time this method is invoked. * * @return <code>true</code> if push can be used; <code>false</code> if push * is not available. */ public boolean ensurePushAvailable() { if (atmosphereAvailable) { return true; } else { if (!pushWarningEmitted) { pushWarningEmitted = true; getLogger().warn(ATMOSPHERE_MISSING_ERROR); } return false; } }
private static boolean checkAtmosphereSupport() { String rawVersion = AtmospherePushConnection.getAtmosphereVersion(); if (rawVersion == null) { return false; } if (!Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION.equals(rawVersion)) { getLogger().warn(INVALID_ATMOSPHERE_VERSION_WARNING, new Object[] { Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION, rawVersion }); } return true; }
/** * Tries to acquire default class loader and sets it as a class loader for * this {@link VaadinService} if found. If current security policy disallows * acquiring class loader instance it will log a message and re-throw * {@link SecurityException} * * @throws SecurityException * If current security policy forbids acquiring class loader */ protected void setDefaultClassLoader() { try { setClassLoader( VaadinServiceClassLoaderUtil.findDefaultClassLoader()); } catch (SecurityException e) { getLogger().error(CANNOT_ACQUIRE_CLASSLOADER_SEVERE, e); throw e; } }
/** * 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().debug("Removing closed UI {}", ui.getUIId()); session.removeUI(ui); }); } } }
/** * Closes those UIs in the given session for which {@link #isUIActive} * yields false. */ 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().debug("Closing inactive UI #{} in session {}", ui.getUIId(), sessionId); ui.close(); }); } } }
Logger logger = getLogger(); logger.debug("The application has the following routes: "); getRouteRegistry().getRegisteredRoutes().stream().map(Object::toString)
closeSession(session); if (session.getSession() != null) { getLogger().debug("Closing inactive session {}", session.getSession().getId());
getLogger() .warn("Failed to write critical notification response to the client", e);
return wrapJsonForClient(json); } catch (JsonException e) { getLogger() .warn("Error creating critical notification JSON message", e);