Interface UndoableDomainObject

    • Method Detail

      • startTransaction

        int startTransaction​(java.lang.String description)
        Start a new transaction in order to make changes to this domain object. All changes must be made in the context of a transaction. If a transaction is already in progress, a sub-transaction of the current transaction will be returned.
        Parameters:
        description - brief description of transaction
        Returns:
        transaction ID
        Throws:
        DomainObjectLockedException - the domain object is currently locked
        TerminatedTransactionException - an existing transaction which has not yet ended was terminated early. Sub-transactions are not permitted until the terminated transaction ends.
      • startTransaction

        int startTransaction​(java.lang.String description,
                             AbortedTransactionListener listener)
        Start a new transaction in order to make changes to this domain object. All changes must be made in the context of a transaction. If a transaction is already in progress, a sub-transaction of the current transaction will be returned.
        Parameters:
        description - brief description of transaction
        listener - listener to be notified if the transaction is aborted.
        Returns:
        transaction ID
        Throws:
        DomainObjectLockedException - the domain object is currently locked
        TerminatedTransactionException - an existing transaction which has not yet ended was terminated early. Sub-transactions are not permitted until the terminated transaction ends.
      • endTransaction

        void endTransaction​(int transactionID,
                            boolean commit)
        Terminate the specified transaction for this domain object.
        Parameters:
        transactionID - transaction ID obtained from startTransaction method
        commit - if true the changes made in this transaction will be marked for commit, if false this and any concurrent transaction will be rolled-back.
      • getCurrentTransaction

        Transaction getCurrentTransaction()
        Returns the current transaction
        Returns:
        the current transaction
      • hasTerminatedTransaction

        boolean hasTerminatedTransaction()
        Returns true if the last transaction was terminated externally from the action that started it.
      • getSynchronizedDomainObjects

        DomainObject[] getSynchronizedDomainObjects()
        Return array of all domain objects synchronized with a shared transaction manager.
        Returns:
        returns array of synchronized domain objects or null if this domain object is not synchronized with others.
      • addSynchronizedDomainObject

        void addSynchronizedDomainObject​(DomainObject domainObj)
                                  throws LockException
        Synchronize the specified domain object with this domain object using a shared transaction manager. If either or both is already shared, a transition to a single shared transaction manager will be performed.
        Parameters:
        domainObj -
        Throws:
        LockException - if lock or open transaction is active on either this or the specified domain object
      • releaseSynchronizedDomainObject

        void releaseSynchronizedDomainObject()
                                      throws LockException
        Remove this domain object from a shared transaction manager. If this object has not been synchronized with others via a shared transaction manager, this method will have no affect.
        Throws:
        LockException - if lock or open transaction is active