/** * @return {@code true} if {@link #deferredWrite} is enabled <i>and</i> at least one entry in the local * cache is dirty; otherwise, {@code false} */ public boolean sessionChanged() { for (Map.Entry<String, LocalCacheEntry> entry : localCache.entrySet()) { if (entry.getValue().isDirty()) { return true; } } return false; }
/** * @return {@code true} if {@link #deferredWrite} is enabled <i>and</i> at least one entry in the local * cache is dirty; otherwise, {@code false} */ public boolean sessionChanged() { for (Map.Entry<String, LocalCacheEntry> entry : localCache.entrySet()) { if (entry.getValue().isDirty()) { return true; } } return false; }
public void updateReloadFlag() { for (Map.Entry<String, LocalCacheEntry> entry : localCache.entrySet()) { if (!entry.getValue().isDirty()) { entry.getValue().setReload(true); } } } } // END of HazelSession
public void updateReloadFlag() { for (Map.Entry<String, LocalCacheEntry> entry : localCache.entrySet()) { if (!entry.getValue().isDirty()) { entry.getValue().setReload(true); } } } } // END of HazelSession
void sessionDeferredWrite() { if (sessionChanged() || isNew()) { Map<String, Object> updates = new HashMap<String, Object>(); Iterator<Map.Entry<String, LocalCacheEntry>> iterator = localCache.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, LocalCacheEntry> entry = iterator.next(); LocalCacheEntry cacheEntry = entry.getValue(); if (cacheEntry.isDirty() && !cacheEntry.isTransient()) { if (cacheEntry.isRemoved()) { updates.put(entry.getKey(), null); } else { updates.put(entry.getKey(), cacheEntry.getValue()); } cacheEntry.setDirty(false); } } try { webFilter.getClusteredSessionService().updateAttributes(id, updates); } catch (Exception ignored) { EmptyStatement.ignore(ignored); } } }
void sessionDeferredWrite() { if (sessionChanged() || isNew()) { Map<String, Object> updates = new HashMap<String, Object>(); Iterator<Map.Entry<String, LocalCacheEntry>> iterator = localCache.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, LocalCacheEntry> entry = iterator.next(); LocalCacheEntry cacheEntry = entry.getValue(); if (cacheEntry.isDirty() && !cacheEntry.isTransient()) { if (cacheEntry.isRemoved()) { updates.put(entry.getKey(), null); } else { updates.put(entry.getKey(), cacheEntry.getValue()); } cacheEntry.setDirty(false); } } try { webFilter.getClusteredSessionService().updateAttributes(id, updates); } catch (HazelcastSerializationException e) { LOGGER.warning("Failed to serialize session with ID [" + id + "]:" + e.getMessage(), e); } catch (Exception e) { LOGGER.warning("Unexpected error occurred.", e); } } }