de.qfs.lib.transaction
Class CommitableStateChange
java.lang.Object
|
+--de.qfs.lib.transaction.CommitableStateChange
- All Implemented Interfaces:
- Commitable
- public class CommitableStateChange
- extends java.lang.Object
- implements Commitable
As part of a Transaction
the CommitableStateChange
tells a StateHolder
when to save and restore
its state.
- Since:
- 0.97.0
- Version:
- $Revision: 1.5 $
- Author:
- Gregor Schmid
Method Summary |
void |
commit()
Tell the StateHolder that its saved state will no longer be needed. |
void |
rollback()
Undo the StateHolder's change of state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
stateHolder
protected StateHolder stateHolder
- The
StateHolder
whose state is about to change.
saved
protected java.lang.Object saved
- Some information handed back by
saveState
.
CommitableStateChange
public CommitableStateChange(StateHolder stateHolder)
- Create a new CommitableStateChange.
- Parameters:
stateHolder
- The StateHolder whose state is about to change.
commit
public void commit()
throws FatalTransactionException
- Tell the StateHolder that its saved state will no longer be needed.
- Specified by:
commit
in interface Commitable
- Throws:
FatalTransactionException
- If the StateHolder fails to commit
its state in a way that corrupts the whole Transaction.
rollback
public void rollback()
throws FatalTransactionException
- Undo the StateHolder's change of state.
- Specified by:
rollback
in interface Commitable
- Throws:
FatalTransactionException
- If the StateHolder fails to restore
its state in a way that corrupts the whole Transaction.