001// Copyright 2008, 2011 The Apache Software Foundation 002// 003// Licensed under the Apache License, Version 2.0 (the "License"); 004// you may not use this file except in compliance with the License. 005// You may obtain a copy of the License at 006// 007// http://www.apache.org/licenses/LICENSE-2.0 008// 009// Unless required by applicable law or agreed to in writing, software 010// distributed under the License is distributed on an "AS IS" BASIS, 011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 012// See the License for the specific language governing permissions and 013// limitations under the License. 014 015package org.apache.tapestry5; 016 017/** 018 * An optional interface implemented by objects that are persisted in the {@link org.apache.tapestry5.services.Session}. 019 * At the end of each request, any objects read from the session are re-stored into the session, to ensure that 020 * in-memory changes are flushed to other persistent session stores (e.g. RDBMS, servers in a cluster, etc). Objects 021 * that implement this interface are expected to track when they are dirty (have pending changes), so that the save 022 * back into the session can be avoided when not necessary. 023 * <p> 024 * This method is accessed concurrently. 025 * 026 * @see org.apache.tapestry5.annotations.ImmutableSessionPersistedObject 027 * @see org.apache.tapestry5.services.SessionPersistedObjectAnalyzer 028 * @since 5.1.1.0 029 */ 030public interface OptimizedSessionPersistedObject 031{ 032 /** 033 * @return true if the object has in-memory changes since the last time this method was called. 034 */ 035 boolean checkAndResetDirtyMarker(); 036}