qflib 0.98.0

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

Field Summary
protected  java.lang.Object saved
          Some information handed back by saveState.
protected  StateHolder stateHolder
          The StateHolder whose state is about to change.
 
Constructor Summary
CommitableStateChange(StateHolder stateHolder)
          Create a new CommitableStateChange.
 
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
 

Field Detail

stateHolder

protected StateHolder stateHolder
The StateHolder whose state is about to change.

saved

protected java.lang.Object saved
Some information handed back by saveState.
Constructor Detail

CommitableStateChange

public CommitableStateChange(StateHolder stateHolder)
Create a new CommitableStateChange.
Parameters:
stateHolder - The StateHolder whose state is about to change.
Method Detail

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.

qflib 0.98.0