Search in sources :

Example 1 with DeltaSessionUpdateAttributeEvent

use of org.apache.geode.modules.session.catalina.internal.DeltaSessionUpdateAttributeEvent in project geode by apache.

the class DeltaSession8 method setAttribute.

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);
        }
    }
}
Also used : DeltaSessionAttributeEvent(org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent) DeltaSessionUpdateAttributeEvent(org.apache.geode.modules.session.catalina.internal.DeltaSessionUpdateAttributeEvent)

Example 2 with DeltaSessionUpdateAttributeEvent

use of org.apache.geode.modules.session.catalina.internal.DeltaSessionUpdateAttributeEvent in project geode by apache.

the class DeltaSession method setAttribute.

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);
        }
    }
}
Also used : DeltaSessionAttributeEvent(org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent) DeltaSessionUpdateAttributeEvent(org.apache.geode.modules.session.catalina.internal.DeltaSessionUpdateAttributeEvent)

Example 3 with DeltaSessionUpdateAttributeEvent

use of org.apache.geode.modules.session.catalina.internal.DeltaSessionUpdateAttributeEvent in project geode by apache.

the class DeltaSession7 method setAttribute.

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);
        }
    }
}
Also used : DeltaSessionAttributeEvent(org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent) DeltaSessionUpdateAttributeEvent(org.apache.geode.modules.session.catalina.internal.DeltaSessionUpdateAttributeEvent)

Aggregations

DeltaSessionAttributeEvent (org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent)3 DeltaSessionUpdateAttributeEvent (org.apache.geode.modules.session.catalina.internal.DeltaSessionUpdateAttributeEvent)3