Interface ITwoPhaseTransaction

    • Method Detail

      • requestCommit

        boolean requestCommit()
        Request a file system transaction.

        When this method returns true it has sucessfully moved the source file to it's new location, and has successfully created a backup copy of the destination file, if it existed before.

        Throws:
        IllegalStateException - If the two-phase commit protocol was violated.
      • commit

        void commit()
        Commit the transaction.
        Throws:
        IllegalStateException - If the two-phase commit protocol was violated.
      • rollback

        boolean rollback()
        Try to rollback the file system transaction.
        Returns:
        true if the rollback was successful, or false otherwise. In the latter case getLastError() may give additional information about why the rollback failed. A backup may exist then.
        Throws:
        IllegalStateException - If the two-phase commit protocol was violated.
      • getLastError

        Throwable getLastError()
        Returns:
        The last exception that was caugth during the transaction, or null if no error occurred;