for (Map.Entry<String, String> entry : sessions.entrySet()) {
String realId = entry.getKey();
String owner = entry.getValue();
long ts = -1;
DistributableSessionMetadata md = null;
try {
IncomingDistributableSessionData sessionData = this.distributedCacheManager.getSessionData(realId, owner, false);
if (sessionData == null) {
log.debugf("Metadata unavailable for unloaded session %s", realId);
continue;
}
ts = sessionData.getTimestamp();
md = sessionData.getMetadata();
} catch (Exception e) {
// most likely a lock conflict if the session is being updated remotely;
// ignore it and use default values for timestamp and maxInactive
log.debug("Problem reading metadata for session " + realId + " -- " + e.toString(), e);
}
long lastMod = ts == -1 ? System.currentTimeMillis() : ts;
int maxLife = md == null ? getMaxInactiveInterval() : md.getMaxInactiveInterval();
OwnedSessionUpdate osu = new OwnedSessionUpdate(owner, lastMod, maxLife, false);
unloadedSessions.put(realId, osu);
}