Interface Transaction
public interface Transaction
OsidTransaction is used by an OsidSession to provide
transactions across its methods. Transactions are performed within a
session. Coordination of transactions across OSIDS of there sessions
requires the availability of a transaction manager.
A trsnaction is started upon creation of an OsidTransaction .
Actions within a session are queued until the transaction is committed or
aborted.
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Cancels this transaction, rolling back the queue of operations since the start of this transaction.voidcommit()Commits the transaction and makes the state change(s) visible.getState()Gets the current state of this transaction.voidprepare()Prepares for acommit.
-
Method Details
-
prepare
void prepare() throws OperationFailedException, PermissionDeniedException, TransactionFailureExceptionPrepares for acommit. No further operations are permitted in the associated manager until this transaction is committed or aborted.- Throws:
IllegalStateException- this transaction has been committed or abortedOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureTransactionFailureException- this transaction cannot proceed due to a bad transaction element- Compliance:
mandatory- This method must be implemented.- Notes:
The- provider must verify this transaction such that a {@code commit} will succeed and reliably record the state changes resulting from this transaction before returning.
-
commit
Commits the transaction and makes the state change(s) visible. This transaction is effectively closed and the only valid method that may be invoked isgetState().- Throws:
IllegalStateException- this transaction has been committed or abortedOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
Any- resources allocated for this transaction can be released.
-
abort
void abort()Cancels this transaction, rolling back the queue of operations since the start of this transaction. This transaction is effectively closed and the only valid method that may be invoked isgetState().- Throws:
IllegalStateException- this transaction has been committed or aborted- Compliance:
mandatory- This method must be implemented.- Notes:
Any- resources allocated for this transaction can be released.
-
getState
TransactionState getState()Gets the current state of this transaction.- Returns:
- the current state of this transaction
- Compliance:
mandatory- This method must be implemented.
-