@SuppressWarnings({"unchecked", "rawtypes"}) protected Map<String, byte[]> getSerializedAttributes() { // Iterate the values and serialize them if necessary before sending them to the server. This // makes the application classes unnecessary on the server. Map<String, byte[]> serializedAttributes = new ConcurrentHashMap<>(); for (Iterator i = getAttributes().entrySet().iterator(); i.hasNext();) { Map.Entry<String, Object> entry = (Map.Entry<String, Object>) i.next(); Object value = entry.getValue(); byte[] serializedValue = value instanceof byte[] ? (byte[]) value : serialize(value); serializedAttributes.put(entry.getKey(), serializedValue); } return serializedAttributes; }
private byte[] getSerializedPrincipal() { if (this.serializedPrincipal == null) { if (this.principal != null && this.principal instanceof GenericPrincipal) { GenericPrincipal gp = (GenericPrincipal) this.principal; SerializablePrincipal sp = SerializablePrincipal.createPrincipal(gp); this.serializedPrincipal = serialize(sp); if (manager != null) { DeltaSessionManager mgr = (DeltaSessionManager) getManager(); if (mgr.getLogger().isDebugEnabled()) { mgr.getLogger().debug(this + ": Serialized principal: " + sp); // mgr.logCurrentStack(); } } } } return this.serializedPrincipal; }
@Override public void setAttribute(String name, Object value, boolean notify) { checkBackingCacheAvailable(); synchronized (this.changeLock) { // Serialize the value byte[] serializedValue = serialize(value); // Store the attribute locally if (this.preferDeserializedForm) { super.setAttribute(name, value, true); } else { super.setAttribute(name, serializedValue, true); } if (serializedValue == null) { return; } // Create the update attribute message DeltaSessionAttributeEvent event = new DeltaSessionUpdateAttributeEvent(name, serializedValue); queueAttributeEvent(event, true); // Distribute the update if (!isCommitEnabled()) { putInRegion(getOperatingRegion(), true, null); } } }
@SuppressWarnings({"unchecked", "rawtypes"}) protected Map<String, byte[]> getSerializedAttributes() { // Iterate the values and serialize them if necessary before sending them to the server. This // makes the application classes unnecessary on the server. Map<String, byte[]> serializedAttributes = new ConcurrentHashMap<String, byte[]>(); for (Iterator i = this.attributes.entrySet().iterator(); i.hasNext();) { Map.Entry<String, Object> entry = (Map.Entry<String, Object>) i.next(); Object value = entry.getValue(); byte[] serializedValue = value instanceof byte[] ? (byte[]) value : serialize(value); serializedAttributes.put(entry.getKey(), serializedValue); } return serializedAttributes; }
private byte[] getSerializedPrincipal() { if (this.serializedPrincipal == null) { if (this.principal != null && this.principal instanceof GenericPrincipal) { GenericPrincipal gp = (GenericPrincipal) this.principal; SerializablePrincipal sp = SerializablePrincipal.createPrincipal(gp); this.serializedPrincipal = serialize(sp); if (manager != null) { DeltaSessionManager mgr = (DeltaSessionManager) getManager(); if (mgr.getLogger().isDebugEnabled()) { mgr.getLogger().debug(this + ": Serialized principal: " + sp); // mgr.logCurrentStack(); } } } } return this.serializedPrincipal; }
public void setAttribute(String name, Object value, boolean notify) { checkBackingCacheAvailable(); synchronized (this.changeLock) { // Serialize the value byte[] serializedValue = serialize(value); // Store the attribute locally if (this.preferDeserializedForm) { super.setAttribute(name, value, true); } else { super.setAttribute(name, serializedValue, true); } if (serializedValue == null) { return; } // Create the update attribute message DeltaSessionAttributeEvent event = new DeltaSessionUpdateAttributeEvent(name, serializedValue); queueAttributeEvent(event, true); // Distribute the update if (!isCommitEnabled()) { putInRegion(getOperatingRegion(), true, null); } } }