Package org.jvnet.hk2.config
Interface Transactor
- All Known Implementing Classes:
WriteableView
public interface Transactor
Any object that want to be part of a configuration transaction
should implement this interface.
- Author:
- Jerome Dochez
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort(Transaction t) Aborts this Transaction, reverting the statebooleanReturns true of this Transaction can be committed on this objectCommit this Transaction.booleanjoin(Transaction t) Enter a new Transaction, this method should return false if this object is already enlisted in another transaction, or cannot be enlisted with the passed transaction.
-
Method Details
-
join
Enter a new Transaction, this method should return false if this object is already enlisted in another transaction, or cannot be enlisted with the passed transaction. If the object returns true, the object is enlisted in the passed transaction and cannot be enlisted in another transaction until either commit or abort has been issued.- Parameters:
t- the transaction to enlist with- Returns:
- true if the enlisting with the passed transaction was accepted, false otherwise
-
canCommit
Returns true of this Transaction can be committed on this object- Parameters:
t- is the transaction to commit, should be the same as the one passed during the join(Transaction t) call.- Returns:
- true if the transaction committing would be successful
- Throws:
TransactionFailure- if the changes cannot be validated
-
commit
Commit this Transaction.- Parameters:
t- the transaction commiting.- Returns:
- list of applied property changes
- Throws:
TransactionFailure- if the transaction commit failed
-
abort
Aborts this Transaction, reverting the state- Parameters:
t- the aborting transaction
-