|
|
@@ -7,6 +7,29 @@ import com.vaadin.data.Property; |
|
|
|
import com.vaadin.data.Property.ValueChangeEvent;
|
|
|
|
import com.vaadin.data.Property.ValueChangeNotifier;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Wrapper class that helps implement two-phase commit for a non-transactional
|
|
|
|
* property.
|
|
|
|
*
|
|
|
|
* When accessing the property through the wrapper, getting and setting the
|
|
|
|
* property value take place immediately. However, the wrapper keeps track of
|
|
|
|
* the old value of the property so that it can be set for the property in case
|
|
|
|
* of a roll-back. This can result in the underlying property value changing
|
|
|
|
* multiple times (first based on modifications made by the application, then
|
|
|
|
* back upon roll-back).
|
|
|
|
*
|
|
|
|
* Value change events on the {@link TransactionalPropertyWrapper} are only
|
|
|
|
* fired at the end of a successful transaction, whereas listeners attached to
|
|
|
|
* the underlying property may receive multiple value change events.
|
|
|
|
*
|
|
|
|
* @see com.vaadin.data.Property.Transactional
|
|
|
|
*
|
|
|
|
* @author Vaadin Ltd
|
|
|
|
* @version @version@
|
|
|
|
* @since 7.0
|
|
|
|
*
|
|
|
|
* @param <T>
|
|
|
|
*/
|
|
|
|
public class TransactionalPropertyWrapper<T> extends AbstractProperty<T>
|
|
|
|
implements ValueChangeNotifier, Property.Transactional<T> {
|
|
|
|
|