Class XTSBARecoveryManagerImple

java.lang.Object
org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager
org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManagerImple

public class XTSBARecoveryManagerImple extends XTSBARecoveryManager
A class which manages the table of recovered participant records.
  • Constructor Details

    • XTSBARecoveryManagerImple

      public XTSBARecoveryManagerImple(TxLog txLog)
      constructor for use by BAParticipantRecoveryModule and BACoordinatorRecoveryModule
      Parameters:
      txLog -
  • Method Details

    • isRecoveryManagerInitialised

      public static boolean isRecoveryManagerInitialised()
    • registerRecoveryModule

      public void registerRecoveryModule(XTSBARecoveryModule module) throws NullPointerException
      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
      Specified by:
      registerRecoveryModule in class XTSBARecoveryManager
      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 void unregisterRecoveryModule(XTSBARecoveryModule module) throws NoSuchElementException
      unregister an application specific recovery module previously registered as a helper to recretae WS-BA durable participants
      Specified by:
      unregisterRecoveryModule in class XTSBARecoveryManager
      Parameters:
      module - the module to be unregistered
      Throws:
      NoSuchElementException - if the module is not currently registered
    • writeParticipantRecoveryRecord

      public boolean writeParticipantRecoveryRecord(BAParticipantRecoveryRecord participantRecoveryRecord)
      save the supplied participant recovery record to persistent storage
      Specified by:
      writeParticipantRecoveryRecord in class XTSBARecoveryManager
      Parameters:
      participantRecoveryRecord -
    • deleteParticipantRecoveryRecord

      public boolean deleteParticipantRecoveryRecord(String id)
      remove any participant recovery record with the supplied id from persistent storage
      Specified by:
      deleteParticipantRecoveryRecord in class XTSBARecoveryManager
      Parameters:
      id - the id of the participant whose recovery details are being deleted
    • isParticipantPresent

      public boolean isParticipantPresent(Uid uid)
      test whether the supplied uid identifies an active participant or a recovered but inactive participant n.b. this method is not synchronized because of two assumptions: first, that uids are never reused; and second that only recovery scanning (as a minimum, for a given recovery record type) is single-threaded. Correctness of the first assumption ensures there are no races with participant processor threads, the second races between recovery threads.
      Specified by:
      isParticipantPresent in class XTSBARecoveryManager
      Parameters:
      uid -
    • addParticipantRecoveryRecord

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

      public BAParticipantRecoveryRecord findParticipantRecoveryRecord(String id)
      see if a participant recovery record with a given id exists in the table of participants which need to be recreated following recovery
      Specified by:
      findParticipantRecoveryRecord in class XTSBARecoveryManager
      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 void recoverParticipants()
      process all entries in the recovered participant map and attempt to recreate the application participant and activate it
      Specified by:
      recoverParticipants in class XTSBARecoveryManager
    • isParticipantRecoveryStarted

      public 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.
      Specified by:
      isParticipantRecoveryStarted in class XTSBARecoveryManager
    • isCoordinatorRecoveryStarted

      public 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.
      Specified by:
      isCoordinatorRecoveryStarted in class XTSBARecoveryManager
    • isSubordinateCoordinatorRecoveryStarted

      public boolean isSubordinateCoordinatorRecoveryStarted()
      Description copied from class: XTSBARecoveryManager
      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.
      Specified by:
      isSubordinateCoordinatorRecoveryStarted in class XTSBARecoveryManager
    • setCoordinatorRecoveryStarted

      public void setCoordinatorRecoveryStarted()
      record the fact that the first BA coordinator recovery scan has completed.
      Specified by:
      setCoordinatorRecoveryStarted in class XTSBARecoveryManager
    • setSubordinateCoordinatorRecoveryStarted

      public void setSubordinateCoordinatorRecoveryStarted()
      Description copied from class: XTSBARecoveryManager
      record the fact that the first BA subordinate coordinator recovery scan has completed.
      Specified by:
      setSubordinateCoordinatorRecoveryStarted in class XTSBARecoveryManager