Class DisposeRecord


public class DisposeRecord extends CadaverRecord
  • Constructor Details

  • Method Details

    • propagateOnAbort

      public boolean propagateOnAbort()
      Description copied from class: CadaverRecord
      Override default AbstractRecord method. CadaverRecords are propagated regardless of the termination condition.
      Overrides:
      propagateOnAbort in class CadaverRecord
      Returns:
      true
    • typeIs

      public int typeIs()
      Description copied from class: CadaverRecord
      The type of the record.
      Overrides:
      typeIs in class CadaverRecord
      Returns:
      RecordType.PERSISTENT
      See Also:
    • nestedAbort

      public int nestedAbort()
      Description copied from class: CadaverRecord
      The nested transaction has aborted. The record will invalidate any new state.
      Overrides:
      nestedAbort in class CadaverRecord
      Returns:
      TwoPhaseOutcome to indicate success/failure.
      See Also:
    • nestedCommit

      public int nestedCommit()
      Description copied from class: RecoveryRecord
      nestedCommit does nothing since the passing of the state up to the parent action is handled by the record list merging system. In fact since nestedPrepare returns PREPARE_READONLY this function should never actually be called
      Overrides:
      nestedCommit in class RecoveryRecord
      Returns:
      TwoPhaseOutcome to indicate success/failure.
      See Also:
    • nestedPrepare

      public int nestedPrepare()
      Description copied from class: CadaverRecord
      The nested transaction is preparing. If there is any new state for the object being removed, and that state is valid, then this record will call nestedPrepare on the object being removed. If we have no new state then we cannot commit and must force an abort. Do this by failing the prepare phase.
      Overrides:
      nestedPrepare in class CadaverRecord
      Returns:
      TwoPhaseOutcome to indicate success/failure.
      See Also:
    • topLevelAbort

      public int topLevelAbort()
      Description copied from class: CadaverRecord
      The nested transaction has aborted. Invalidate any new state.
      Overrides:
      topLevelAbort in class CadaverRecord
      Returns:
      TwoPhaseOutcome to indicate success/failure.
      See Also:
    • topLevelCommit

      public int topLevelCommit()
      At topLevelCommit we remove the state from the object participantStore.
      Overrides:
      topLevelCommit in class CadaverRecord
      Returns:
      TwoPhaseOutcome to indicate success/failure.
      See Also:
    • topLevelPrepare

      public int topLevelPrepare()
      Description copied from class: CadaverRecord
      At topLevelPrepare write uncommitted version into object participantStore. Cannot use inherited version since that assumes object is alive instead talk directly to the object participantStore itself.
      Overrides:
      topLevelPrepare in class CadaverRecord
      Returns:
      TwoPhaseOutcome to indicate success/failure.
      See Also:
    • print

      public void print(PrintWriter strm)
      Description copied from class: CadaverRecord
      Override AbstractRecord.print to write specific information to the specified stream.
      Overrides:
      print in class CadaverRecord
      Parameters:
      strm - the stream to use.
    • doSave

      public boolean doSave()
      Description copied from class: CadaverRecord
      Override the AbstractRecord.doSave.
      Overrides:
      doSave in class CadaverRecord
      Returns:
      true if the object being removed is a persistent object (RecordType.PERSISTENT). false otherwise.
      See Also:
    • save_state

      public boolean save_state(OutputObjectState os, int ot)
      Description copied from class: AbstractRecord
      When the transaction is required to make the intentions list persistent, it scans the list and asks each record whether or not it requires state to be saved (by calling doSave). If the answer is yes, then save_state is called and the record instance must save enough information to enable it to be restored from that state later. The basic AbstractRecord save_state will save common data that is required by the base class during recovery. If a derived class calls super.save_state then it must be called before packing any other data item.
      Overrides:
      save_state in class PersistenceRecord
      Returns:
      true if successful, false otherwise.
    • restore_state

      public boolean restore_state(InputObjectState os, int ot)
      Description copied from class: AbstractRecord
      During recovery, the transaction log is given to the recovery system and it will recreate a transaction instance to perform necessary recovery actions. This transaction will recreate the intentions list and give each recreated AbstractRecord the state that that was saved during transaction persistence. The base class will restore information that it needs from the log. Data items must be unpacked in the same order that they were packed.
      Overrides:
      restore_state in class PersistenceRecord
      Returns:
      true if successful, false otherwise.
    • type

      public String type()
      Description copied from class: CadaverRecord
      The type of the class - may be used to save information in an hierarchical manner in the object participantStore.
      Overrides:
      type in class CadaverRecord
    • shouldAdd

      public boolean shouldAdd(AbstractRecord a)
      Description copied from class: AbstractRecord
      Should we add the record presented to the intentions list?
      Overrides:
      shouldAdd in class RecoveryRecord
      Parameters:
      a - The record to try to add.
      Returns:
      true if the record should be added, false otherwise.
    • shouldMerge

      public boolean shouldMerge(AbstractRecord a)
      Description copied from class: CadaverRecord
      Overrides AbstractRecord.shouldMerge
      Overrides:
      shouldMerge in class CadaverRecord
      Parameters:
      a - the record to potentially merge with.
      Returns:
      true if this instance and the parameter have the same id (order()) and the parameter is either persistent or recoverable. false otherwise.
      See Also:
    • shouldReplace

      public boolean shouldReplace(AbstractRecord a)
      Description copied from class: CadaverRecord
      Overrides AbstractRecord.shouldReplace
      Overrides:
      shouldReplace in class CadaverRecord
      Parameters:
      a - the record to potentially replace this instance.
      Returns:
      true if this instance and the parameter have the same id (order()) and the parameter is either persistent or recoverable. false otherwise.
      See Also:
    • shouldAlter

      public boolean shouldAlter(AbstractRecord a)
      Description copied from class: AbstractRecord
      Should we alter the current record with the one presented?
      Overrides:
      shouldAlter in class RecoveryRecord
      Parameters:
      a - The record to try to alter.
      Returns:
      true if the record should be altered, false otherwise.