private static long getExpirationTime(Session session) { long lastAccessedTime = session.getLastAccessedTime(); if (lastAccessedTime < 0) { return Long.MIN_VALUE; } return lastAccessedTime + session.getMaxInactiveInterval(); }
public void publishMessages() { Iterator<String> itr = serializedMessages.iterator(); while (itr.hasNext()) { String message = itr.next(); for (Session session : sessions) { session.push(key, message); } itr.remove(); } synchronized (this) { submittedForPublishing = false; if (!serializedMessages.isEmpty()) { submitForPublishing(); } } }