VR
- The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public abstract class AbstractTransactionPolicy<VR> extends AbstractPolicy<VR>
IPolicy
that is transactional.Constructor and Description |
---|
AbstractTransactionPolicy() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInitialized()
Checks whether this
AbstractTransactionPolicy is initialized and
throws an IllegalStateException if not. |
ITransactionalOperation |
commit()
Returns an
ITransactionalOperation that performs all
manipulations applied by the policy since the last init() call. |
protected abstract ITransactionalOperation |
createOperation()
Creates an
ITransactionalOperation that is used to encapsulate
the changes that are applied by this AbstractTransactionPolicy
through its "work" methods. |
protected ITransactionalOperation |
getOperation()
Returns the
ITransactionalOperation that is used to encapsulate
the changes that are applied by this AbstractTransactionPolicy
through its "work" methods. |
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
protected boolean |
isInitialized()
Returns whether this
AbstractTransactionPolicy is initialized or
not. |
protected void |
locallyExecuteOperation()
Locally executes the
ITransactionalOperation that is updated by
this policy, i.e. not on the operation history. |
void |
rollback()
Puts back this policy into an uninitialized state, reverting any changes
that have been applied via the policy's work methods last
init()
call. |
getAdaptable, getHost, setAdaptable
protected void checkInitialized()
AbstractTransactionPolicy
is initialized and
throws an IllegalStateException if not.public ITransactionalOperation commit()
ITransactionalOperation
that performs all
manipulations applied by the policy since the last init()
call.
When called multiple times in sequence, only the first call will yield an
operation, the subsequent calls will yield null
.ITransactionalOperation
that performs all
manipulations applied by the policy since the last
init()
call.protected abstract ITransactionalOperation createOperation()
ITransactionalOperation
that is used to encapsulate
the changes that are applied by this AbstractTransactionPolicy
through its "work" methods. The created operation should allow for
local execution
at each time.ITransactionalOperation
to encapsulate all applied
changes.protected final ITransactionalOperation getOperation()
ITransactionalOperation
that is used to encapsulate
the changes that are applied by this AbstractTransactionPolicy
through its "work" methods.ITransactionalOperation
to encapsulate all applied
changes.public void init()
IllegalStateException
. It is safe to call init()
multiple times in sequence.protected boolean isInitialized()
AbstractTransactionPolicy
is initialized or
not.true
if this AbstractTransactionPolicy
is
initialized, false
otherwise.protected void locallyExecuteOperation()
ITransactionalOperation
that is updated by
this policy, i.e. not on the operation history. Maybe used in the "work"
operations of subclasses.public void rollback()
init()
call.Copyright (c) 2014 itemis AG and others. All rights reserved.