Java 类org.springframework.security.web.session.HttpSessionDestroyedEvent 实例源码

项目:hazelcast-wm    文件:SpringAwareWebFilter.java   
@Override
protected void destroySession(HazelcastHttpSession session, boolean invalidate) {
    super.destroySession(session, invalidate);
    if (invalidate) {
        ApplicationContext appContext =
                WebApplicationContextUtils.getWebApplicationContext(servletContext);
        if (appContext != null) {
            ensureSessionRegistryInitialized(appContext);
            if (sessionRegistry != null) {
                String originalSessionId = session.getOriginalSessionId();
                // If original session id is registered already, we don't need it.
                // So, we should remove it also.
                sessionRegistry.removeSessionInformation(originalSessionId);
                /**
                 * Publish an event to notify
                 * {@link org.springframework.security.core.session.SessionRegistry} instance.
                 * So Spring clears information about our Hazelcast session.
                 */
                appContext.publishEvent(new HttpSessionDestroyedEvent(session));

                LOGGER.finest("Published destroy session event for Spring for session with id "
                        + session.getId());
            }
        }
    }
}
项目:owf-security    文件:ClusteredSessionRegistryImpl.java   
@Override
public void onApplicationEvent(SessionDestroyedEvent event) {
    logger.debug("onApplicationEvent");
    if (event instanceof HttpSessionDestroyedEvent) {
        String sessionId = ((HttpSession) event.getSource()).getId();
        removeSessionInformation(sessionId);
    }
}
项目:metaworks_framework    文件:SessionOrderLockManager.java   
@Override
public void onApplicationEvent(HttpSessionDestroyedEvent event) {
    ReentrantLock lock = SESSION_LOCKS.remove(event.getSession().getId());
    if (lock != null && LOG.isDebugEnabled()) {
        LOG.debug("Destroyed lock due to session invalidation: " + lock.toString());
    }
}
项目:SparkCommerce    文件:SessionOrderLockManager.java   
@Override
public void onApplicationEvent(HttpSessionDestroyedEvent event) {
    ReentrantLock lock = SESSION_LOCKS.remove(event.getSession().getId());
    if (lock != null && LOG.isDebugEnabled()) {
        LOG.debug("Destroyed lock due to session invalidation: " + lock.toString());
    }
}
项目:SparkCore    文件:SessionOrderLockManager.java   
@Override
public void onApplicationEvent(HttpSessionDestroyedEvent event) {
    ReentrantLock lock = SESSION_LOCKS.remove(event.getSession().getId());
    if (lock != null && LOG.isDebugEnabled()) {
        LOG.debug("Destroyed lock due to session invalidation: " + lock.toString());
    }
}
项目:cia    文件:HttpSessionDestroyedEventListener.java   
@Override
public void onApplicationEvent(final HttpSessionDestroyedEvent event) {
    final HttpSession httpSession = event.getSession();
    final Collection<SimpleGrantedAuthority> authorities = new ArrayList<>();
    authorities.add(new SimpleGrantedAuthority(ROLE_ANONYMOUS));
    final DestroyApplicationSessionRequest destroyApplicationSessionRequest = new DestroyApplicationSessionRequest();
    destroyApplicationSessionRequest.setSessionId(httpSession.getId());

    SecurityContextHolder.getContext()
            .setAuthentication(new AnonymousAuthenticationToken(KEY, PRINCIPAL, authorities));
    applicationManager.service(destroyApplicationSessionRequest);
    SecurityContextHolder.getContext().setAuthentication(null);

    LOGGER.info(LOG_MSG_SESSION_DESTROYED_SESSION_ID, httpSession.getId());
}
项目:blcdemo    文件:SessionOrderLockManager.java   
@Override
public void onApplicationEvent(HttpSessionDestroyedEvent event) {
    ReentrantLock lock = SESSION_LOCKS.remove(event.getSession().getId());
    if (lock != null && LOG.isDebugEnabled()) {
        LOG.debug("Destroyed lock due to session invalidation: " + lock.toString());
    }
}
项目:eHMP    文件:BoardService.java   
@Override
public void onApplicationEvent(HttpSessionDestroyedEvent event) {
    String blubber = event.getSession().getId();
    List<String> reqs = sessToReqMap.get(blubber);
    if(reqs!=null) {
        for(String req: reqs) {
            tasks.remove(req);
        }
    }
    sessToReqMap.remove(blubber);
}
项目:pcm-api    文件:LoggingSessionDestroyedEventListener.java   
@Override
public void onApplicationEvent(HttpSessionDestroyedEvent event) {
    logger.debug("Session is ended");
}
项目:MBaaS    文件:SessionDestroyedListener.java   
@Override
public void onApplicationEvent(HttpSessionDestroyedEvent httpSessionDestroyedEvent) {
    LOGGER.info("session {} is revoked", httpSessionDestroyedEvent.getId());
}
项目:eHMP    文件:BroadcastService.java   
@Override
public void onApplicationEvent(HttpSessionDestroyedEvent event) {
    expireSessionConsumers(event.getId());
}
项目:molgenis    文件:SecurityContextRegistryImpl.java   
@EventListener
public void handleHttpSessionDestroyedEvent(HttpSessionDestroyedEvent httpSessionDestroyedEvent)
{
    String sessionId = httpSessionDestroyedEvent.getId();
    httpSessionMap.remove(sessionId);
}
项目:molgenis    文件:SecurityContextRegistryImplTest.java   
@Test
public void testHandleHttpSessionDestroyedEvent()
{
    securityContextRegistry.handleHttpSessionDestroyedEvent(
            new HttpSessionDestroyedEvent(httpSessionWithSecurityContext));
}