Package com.iizix.gyro
Class GyroTransaction
java.lang.Object
com.iizix.gyro.GyroTransaction
The gyro transaction class is used to record all changes in a property container for commit/rollback operations.
- Author:
- Christopher Mindus
- Constructor SummaryConstructorsConstructorDescription- GyroTransaction- (PropCnr transactionContainer, IFocusEngine focusEngine) Creates the gyro transaction for a property container.
- Method SummaryModifier and TypeMethodDescription- void- begin()Begins the transaction.- void- commit()Commits the work done in the property container.- void- dispose()Disposes of the instance.- protected void- finalize()Make sure we're always disposed of if garbage collected.Returns the focus engine associated with this Gyro transaction.Returns the focus that is to be set due to the rollback.Returns the transaction property container for the GyroTransaction.- rollback()Rolls back the work done in the transaction and returns the component who's focus must be restored to.
- Constructor Details- GyroTransactionCreates the gyro transaction for a property container.- Parameters:
- transactionContainer- The property container of the transaction, typically a VirtualSpace.
- focusEngine- The focus engine to use, VirtualSpace or Panel, null for none.
 
 
- Method Details- getTransactionContainerReturns the transaction property container for the GyroTransaction.- Returns:
- The property container.
 
- getFocusEngineReturns the focus engine associated with this Gyro transaction.- Returns:
- The focus engine, or null for none.
 
- getRollbackFocusReturns the focus that is to be set due to the rollback.- Returns:
- The focus component, null for none.
 
- finalizeMake sure we're always disposed of if garbage collected.
- disposepublic void dispose()Disposes of the instance. This method should be called when the transaction is canceled.- Note: Calling this method will cancel commit and rollback possibilities! 
- beginpublic void begin()Begins the transaction.- Throws:
- IllegalStateException- If the state of the transaction is not "ready", i.e. the transaction has begun, been committed or rolled back. The exception is also thrown if the property container has been disposed of.
 
- commitpublic void commit()Commits the work done in the property container.- Throws:
- IllegalStateException- If the transaction state is not in "begin" state.
 
- rollbackRolls back the work done in the transaction and returns the component who's focus must be restored to.- Returns:
- The component who had its focus changed first during the transaction and needs to receive focus (perhaps when e.g. the session busy state is released), or nullif no focus change occurred.
- Throws:
- IllegalStateException- If the transaction state is not in "begin" state.
- PropException- If the rollback operation failed.