public class Transaction extends Object
Constructor and Description |
---|
Transaction() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCommit()
Tests if the transaction participants will pass the prepare phase successfully.
|
List<PropertyChangeEvent> |
commit()
Commits all participants to this transaction
|
<T extends ConfigBeanProxy> |
enroll(T source)
Enroll a configuration object in a transaction and returns a writeable view of it
|
static <T extends ConfigBeanProxy> |
getTransaction(T source)
Returns the transaction associated with a writable view
|
void |
rollback()
Rollbacks all participants to this transaction.
|
public void rollback()
public boolean canCommit() throws TransactionFailure
commit()
method will succeed.TransactionFailure
- if the changes are not validpublic List<PropertyChangeEvent> commit() throws RetryableException, TransactionFailure
RetryableException
- if the transaction cannot commit at this time but
could succeed later.TransactionFailure
- if the transaction commit failed.public static <T extends ConfigBeanProxy> Transaction getTransaction(T source)
source
- the proxy to the writable viewpublic <T extends ConfigBeanProxy> T enroll(T source) throws TransactionFailure
source
- the configured interface implementationTransactionFailure
- if the object cannot be enrolled (probably already enrolled in
another transaction).Copyright © 2019. All rights reserved.