Class XTSBARecoveryManager

java.lang.Object
org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager
Direct Known Subclasses:
XTSBARecoveryManagerImple

public abstract class XTSBARecoveryManager extends Object
Abstract class defining API for managing both participant and coordinator recovery On the participant this is responsible for saving WS-BA participant recovery records during prepare, deleting them at commit and recreating and reactivating them during recovery. On the coordinator side it currently merely records whether coordinator recovery has completed its first scan
  • Field Details

    • theRecoveryManager

      protected static volatile XTSBARecoveryManager theRecoveryManager
      the singleton instance of the recovery manager
    • lock

      protected static final Object lock
  • Constructor Details

    • XTSBARecoveryManager

      public XTSBARecoveryManager()
  • Method Details

    • getRecoveryManager

      public static XTSBARecoveryManager getRecoveryManager()
      obtain a reference to the WS-BA recovery manager singleton instance
      Returns:
      the singleton instance
    • setRecoveryManager

      public static XTSBARecoveryManager setRecoveryManager(XTSBARecoveryManager recoveryManager)
      set the WS-BA recovery manager singleton instance
      Parameters:
      recoveryManager - the instance to use as the recovery manager
      Returns:
      the singleton previously in use or null if it was not previously set
    • registerRecoveryModule

      public abstract void registerRecoveryModule(XTSBARecoveryModule module)
      register an application specific recovery module which acts as a helper to recreate a WS-BA durable participant from the participant's recovery data saved at prepare
      Parameters:
      module - the module which will be used to identify and recreate participants for the application
      Throws:
      NullPointerException - if the supplied module is null
    • unregisterRecoveryModule

      public abstract void unregisterRecoveryModule(XTSBARecoveryModule module) throws NoSuchElementException
      unregister an application specific recovery module previously registered as a helper to recretae WS-BA durable participants
      Parameters:
      module - the module to be unregistered
      Throws:
      NoSuchElementException - if the module is not currently registered
    • writeParticipantRecoveryRecord

      public abstract boolean writeParticipantRecoveryRecord(BAParticipantRecoveryRecord participantRecoveryRecord)
      save the supplied participant recovery record to persistent storage
      Parameters:
      participantRecoveryRecord -
    • deleteParticipantRecoveryRecord

      public abstract boolean deleteParticipantRecoveryRecord(String id)
      remove any participant recovery record with the supplied id from persistent storage
      Parameters:
      id -
    • isParticipantPresent

      public abstract boolean isParticipantPresent(Uid uid)
      test whether the supplied uid identifies an active participant or a recovered but inactive participant
      Parameters:
      uid -
    • addParticipantRecoveryRecord

      public abstract void addParticipantRecoveryRecord(Uid uid, BAParticipantRecoveryRecord participantRecoveryRecord)
      add a recovered participant record to the table of unrecovered participants which need to be recreated following recovery
      Parameters:
      uid - the uid under which the participant was saved in the file store
      participantRecoveryRecord - the in-memory represenattion of the recovery record saved to disk
    • findParticipantRecoveryRecord

      public abstract BAParticipantRecoveryRecord findParticipantRecoveryRecord(String id)
      see if a participant recovery record with a given id exists in the table of unrecovered participants
      Parameters:
      id - the identifier of the participant being sought
      Returns:
      the participant recovery record with the supplied id or null if it is not found
    • recoverParticipants

      public abstract void recoverParticipants()
      process all entries in the recovered participant map and attempt to recreate the application participant and activate it
    • isParticipantRecoveryStarted

      public abstract boolean isParticipantRecoveryStarted()
      test whether the first BA participant recovery scan has completed. this indicates whether there may or may not still be unknown participant recovery records on disk. If the first scan has not yet completed then a commit or rollback message for an unknown participant must be dropped. If it has then a commit or rollback for an unknown participant must be acknowledged with, respectively, a committed or aborted message.
    • isCoordinatorRecoveryStarted

      public abstract boolean isCoordinatorRecoveryStarted()
      test whether the first BA coordinator recovery scan has completed. this indicates whether there may or may not still be unknown BA transcation records on disk. If the first scan has not yet completed then a prepare message for an unknown participant must be dropped. If it has then a perpare for an unknown participant must be acknowledged with a rollback message.
    • isSubordinateCoordinatorRecoveryStarted

      public abstract boolean isSubordinateCoordinatorRecoveryStarted()
      test whether the first BA subordinate coordinator recovery scan has completed. this indicates whether there may or may not still be unknown BA subtransaction records on disk. If the first scan has not yet completed then a close or cancel/compensate for an unknown subtransaction must raise an exception delaying commit of the parent transaction.
    • setCoordinatorRecoveryStarted

      public abstract void setCoordinatorRecoveryStarted()
      record the fact that the first BA coordinator recovery scan has completed.
    • setSubordinateCoordinatorRecoveryStarted

      public abstract void setSubordinateCoordinatorRecoveryStarted()
      record the fact that the first BA subordinate coordinator recovery scan has completed.