org.apache.tapestry5.services
Interface SessionPersistedObjectAnalyzer<T>

All Known Implementing Classes:
DefaultSessionPersistedObjectAnalyzer, OptimizedSessionPersistedObjectAnalyzer

@UsesMappedConfiguration(key=java.lang.Class.class,
                         value=SessionPersistedObjectAnalyzer.class)
public interface SessionPersistedObjectAnalyzer<T>

Analyzes a session-persisted object, specifically to see if it is dirty or not.

This service is provided to support applications which store mutable session attributes where the session is replicated to a slower medium (e.g. RDMBS, Cluster, etc) this can help alleviate excessive writes to the session store while ensuring changes are propagated.

The service implementation uses a mapped configuration to form a strategy based on object type. The service may be injected using the Primary marker annotation.

Since:
5.1.0.0
See Also:
ImmutableSessionPersistedObject, OptimizedSessionPersistedObject

Method Summary
 boolean checkAndResetDirtyState(T sessionPersistedObject)
          Atomically check and reset the dirty state of the session persisted object.
 

Method Detail

checkAndResetDirtyState

boolean checkAndResetDirtyState(T sessionPersistedObject)
Atomically check and reset the dirty state of the session persisted object.

The implementer should take consideration for the fact that session attributes are accessed concurrently. A naive check/set algorithm may allow changes to go un-noticed.

Parameters:
sessionPersistedObject - the session attribute (never null)
Returns:
true if the object needs to be re-stored into the session
Since:
5.3


Copyright © 2003-2012 The Apache Software Foundation.