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 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
      • abort

        void abort​(Transaction t)
        Aborts this Transaction, reverting the state
        Parameters:
        t - the aborting transaction