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
 void abort(Transaction t)
          Aborts this Transaction, reverting the state
 boolean canCommit(Transaction t)
          Returns true of this Transaction can be committed on this object
 List<PropertyChangeEvent> commit(Transaction t)
          Commit this Transaction.
 boolean join(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 Detail

join

boolean join(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. 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

boolean canCommit(Transaction t)
                  throws TransactionFailure
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

List<PropertyChangeEvent> commit(Transaction t)
                                 throws TransactionFailure
Commit this Transaction.

Parameters:
t - the transaction commiting.
Returns:
list of applied property changes
Throws:
TransactionFailure - if the transaction commit failed

abort

void abort(Transaction t)
Aborts this Transaction, reverting the state

Parameters:
t - the aborting transaction


Copyright © 2013 Oracle Corporation. All Rights Reserved.