List of usage examples for org.apache.shiro.cache Cache values
public Collection<V> values();
From source file:org.cast.go.message.web.WebSocketController.java
License:Apache License
/** * session?/* w ww. j a v a 2 s. c o m*/ * @return */ @MessageMapping("/online") public void online(User user) { Cache cache = ehCacheManager.getCache(Common.ACTIVE_SESSIONS_CACHE_NAME); Collection<SimpleSession> sessions = cache.values(); for (SimpleSession s : sessions) { MyRealm.ShiroUser shiroUser = (MyRealm.ShiroUser) s.getAttribute("shiroUser"); if (user.getUsername().equals(shiroUser.getUsername())) { s.setLastAccessTime(new Date()); } } }