Example usage for com.vaadin.server VaadinSession getAllSessions

List of usage examples for com.vaadin.server VaadinSession getAllSessions

Introduction

In this page you can find the example usage for com.vaadin.server VaadinSession getAllSessions.

Prototype

public static Collection<VaadinSession> getAllSessions(HttpSession httpSession) 

Source Link

Document

Retrieves all VaadinSession s which are stored in the given HTTP session.

Usage

From source file:org.vaadin.spring.security.shared.VaadinSessionClosingLogoutHandler.java

License:Apache License

@Override
public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
    try {/*w  ww.  j  a  va2s .  co  m*/
        LOGGER.debug("Logging out and closing all Vaadin sessions");
        Collection<VaadinSession> allSessions = VaadinSession.getAllSessions(request.getSession());
        for (VaadinSession session : allSessions) {
            LOGGER.debug("Closing session [{}]", session);
            session.close();
        }
    } catch (Exception ex) {
        LOGGER.error("An exception occurred while attempting to close the Vaadin sessions", ex);
    }
}