public void abort() { this.session.abort(); }
@Override public void apply(Cache cache) { Region<String, DeltaSessionInterface> region = getRegion(cache); DeltaSessionInterface session = region.get(this.key); if (session == null) { StringBuilder builder = new StringBuilder(); builder.append("Session ").append(this.key) .append(" was not found while attempting to apply ").append(this); cache.getLogger().warning(builder.toString()); } else { session.applyAttributeEvents(region, this.eventQueue); if (cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); builder.append("Applied ").append(this); cache.getLogger().fine(builder.toString()); } } }
public void commit() { this.session.commit(); }
@Override public void afterDestroy(EntryEvent<String, HttpSession> event) { // A Session expired. If it was destroyed by GemFire expiration, process it. // If it was destroyed via Session.invalidate, ignore it since it has // already been processed. DeltaSessionInterface session = null; if (event.getOperation() == Operation.EXPIRE_DESTROY) { session = (DeltaSessionInterface) event.getOldValue(); } else { /* * This comes into play when we're dealing with an empty client proxy. We need the actual * destroyed object to come back from the server so that any associated listeners can fire * correctly. Having the destroyed object come back as the callback arg depends on setting the * property gemfire.EXPIRE_SENDS_ENTRY_AS_CALLBACK. */ Object callback = event.getCallbackArgument(); if (callback != null && callback instanceof DeltaSessionInterface) { session = (DeltaSessionInterface) callback; ManagerBase m = ContextMapper.getContext(session.getContextName()); if (m != null) { session.setOwner(m); } } } if (session != null) { session.processExpired(); } }
if (session != null && !session.getContextName().isEmpty() && !getContextName().equals(session.getContextName())) { getLogger() .info(this + ": Session " + id + " rejected as container name and context do not match: " + getContextName() + " != " + session.getContextName()); session = null; session.setNew(false); if (session.getManager() == null) { DeltaSessionInterface ds = (DeltaSessionInterface) session; ds.setOwner(this); ds.activate();
boolean isValid() { return this.session.isValid(); } }
public void remove(Session session, boolean update) { // super.remove(session); // Remove the session from the region if necessary. // It will have already been removed if it expired implicitly. DeltaSessionInterface ds = (DeltaSessionInterface) session; if (ds.getExpired()) { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Expired session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } } else { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Destroying session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } getSessionCache().destroySession(session.getId()); if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Destroyed session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } } }
&& existingSession.getLastAccessedTime() > session.getLastAccessedTime()) { if (getLogger().isDebugEnabled()) { getLogger().debug("Loaded session " + session.getId() + " is older than cached copy");
if (session != null && !session.getContextName().isEmpty() && !getContextName().equals(session.getContextName())) { getLogger() .info(this + ": Session " + id + " rejected as container name and context do not match: " + getContextName() + " != " + session.getContextName()); session = null; session.setNew(false); if (session.getManager() == null) { DeltaSessionInterface ds = (DeltaSessionInterface) session; ds.setOwner(this); ds.activate();
public void afterDestroy(EntryEvent<String, HttpSession> event) { // A Session expired. If it was destroyed by GemFire expiration, process it. // If it was destroyed via Session.invalidate, ignore it since it has // already been processed. DeltaSessionInterface session = null; if (event.getOperation() == Operation.EXPIRE_DESTROY) { session = (DeltaSessionInterface) event.getOldValue(); } else { /* * This comes into play when we're dealing with an empty client proxy. We need the actual * destroyed object to come back from the server so that any associated listeners can fire * correctly. Having the destroyed object come back as the callback arg depends on setting the * property gemfire.EXPIRE_SENDS_ENTRY_AS_CALLBACK. */ Object callback = event.getCallbackArgument(); if (callback != null && callback instanceof DeltaSessionInterface) { session = (DeltaSessionInterface) callback; ManagerBase m = ContextMapper.getContext(session.getContextName()); if (m != null) { session.setOwner(m); } } } if (session != null) { session.processExpired(); } }
boolean isValid() { return this.session.isValid(); } }
public void remove(Session session, boolean update) { // super.remove(session); // Remove the session from the region if necessary. // It will have already been removed if it expired implicitly. DeltaSessionInterface ds = (DeltaSessionInterface) session; if (ds.getExpired()) { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Expired session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } } else { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Destroying session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } getSessionCache().destroySession(session.getId()); if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Destroyed session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } } }
&& existingSession.getLastAccessedTime() > session.getLastAccessedTime()) { if (getLogger().isDebugEnabled()) { getLogger().debug("Loaded session " + session.getId() + " is older than cached copy");
public void abort() { this.session.abort(); }
public void commit() { this.session.commit(); }
public void apply(Cache cache) { Region<String, DeltaSessionInterface> region = getRegion(cache); DeltaSessionInterface session = region.get(this.key); if (session == null) { StringBuilder builder = new StringBuilder(); builder.append("Session ").append(this.key) .append(" was not found while attempting to apply ").append(this); cache.getLogger().warning(builder.toString()); } else { session.applyAttributeEvents(region, this.eventQueue); if (cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); builder.append("Applied ").append(this); cache.getLogger().fine(builder.toString()); } } }