|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.hk2.config.Transaction
public class Transaction
Simple transaction mechanism for config-api objects
Constructor Summary | |
---|---|
Transaction()
|
Method Summary | ||
---|---|---|
boolean |
canCommit()
Tests if the transaction participants will pass the prepare phase successfully. |
|
List<PropertyChangeEvent> |
commit()
Commits all participants to this transaction |
|
|
enroll(T source)
Enroll a configuration object in a transaction and returns a writeable view of it |
|
static
|
getTransaction(T source)
Returns the transaction associated with a writable view |
|
void |
rollback()
Rollbacks all participants to this transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Transaction()
Method Detail |
---|
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 view
public <T extends ConfigBeanProxy> T enroll(T source) throws TransactionFailure
source
- the configured interface implementation
TransactionFailure
- if the object cannot be enrolled (probably already enrolled in
another transaction).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |