Search in sources :

Example 1 with DefaultSessionPersistedObjectAnalyzer

use of org.apache.tapestry5.http.internal.services.DefaultSessionPersistedObjectAnalyzer in project tapestry-5 by apache.

the class TapestryHttpModule method contributeSessionPersistedObjectAnalyzer.

/**
 * Identifies String, Number and Boolean as immutable objects, a catch-all
 * handler for Object (that understands
 * the {@link org.apache.tapestry5.http.annotations.ImmutableSessionPersistedObject} annotation),
 * and a handler for {@link org.apache.tapestry5.http.OptimizedSessionPersistedObject}.
 *
 * @since 5.1.0.0
 */
@SuppressWarnings("rawtypes")
public static void contributeSessionPersistedObjectAnalyzer(MappedConfiguration<Class, SessionPersistedObjectAnalyzer> configuration) {
    configuration.add(Object.class, new DefaultSessionPersistedObjectAnalyzer());
    SessionPersistedObjectAnalyzer<Object> immutable = new SessionPersistedObjectAnalyzer<Object>() {

        public boolean checkAndResetDirtyState(Object sessionPersistedObject) {
            return false;
        }
    };
    configuration.add(String.class, immutable);
    configuration.add(Number.class, immutable);
    configuration.add(Boolean.class, immutable);
    configuration.add(OptimizedSessionPersistedObject.class, new OptimizedSessionPersistedObjectAnalyzer());
}
Also used : SessionPersistedObjectAnalyzer(org.apache.tapestry5.http.services.SessionPersistedObjectAnalyzer) DefaultSessionPersistedObjectAnalyzer(org.apache.tapestry5.http.internal.services.DefaultSessionPersistedObjectAnalyzer) OptimizedSessionPersistedObjectAnalyzer(org.apache.tapestry5.http.internal.services.OptimizedSessionPersistedObjectAnalyzer) DefaultSessionPersistedObjectAnalyzer(org.apache.tapestry5.http.internal.services.DefaultSessionPersistedObjectAnalyzer) OptimizedSessionPersistedObject(org.apache.tapestry5.http.OptimizedSessionPersistedObject) OptimizedSessionPersistedObjectAnalyzer(org.apache.tapestry5.http.internal.services.OptimizedSessionPersistedObjectAnalyzer)

Aggregations

OptimizedSessionPersistedObject (org.apache.tapestry5.http.OptimizedSessionPersistedObject)1 DefaultSessionPersistedObjectAnalyzer (org.apache.tapestry5.http.internal.services.DefaultSessionPersistedObjectAnalyzer)1 OptimizedSessionPersistedObjectAnalyzer (org.apache.tapestry5.http.internal.services.OptimizedSessionPersistedObjectAnalyzer)1 SessionPersistedObjectAnalyzer (org.apache.tapestry5.http.services.SessionPersistedObjectAnalyzer)1