at.spardat.xma.mdl.Transactional Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* s IT Solutions AT Spardat GmbH - initial API and implementation
*******************************************************************************/
// @(#) $Id: Transactional.java 2089 2007-11-28 13:56:13Z s3460 $
package at.spardat.xma.mdl;
/**
* This interface is implemented by classes that provide transactional support.
* In the context of XMA, transactional support does mean: Changes may be applied
* to a Transactional. These changes may be undone via rollback
* or committed via commit.
*
* The states where no changes have been accumulated yet are called syncpoints.
* Syncpoints are construction (where the change list is trivially empty) and the
* states immediately after a rollback or commit call.
*
* @author YSD, 13.04.2003 09:49:46
*/
public interface Transactional {
/**
* Yields true if this WidgetModel has changed since the last syncpoint.
* Some models have a more
* complex state, e.g., a table has a domain and a selection, where either may change.
* In this case, subclasses will
* provide more detailed information on what aspect of the model really has changed.
*
* @return true if changed, false otherwise
*/
public abstract boolean changed();
/**
* This method restores this Widget Model to its last syncpoint (which also becomes
* the new syncpoint).
*/
public abstract void rollback();
/**
* This method clears the change history. Calling rollback afterwards won't
* have any effect. This method defines a new syncpoint.
*/
public abstract void commit();
}