Class XTSATRecoveryManagerImple

java.lang.Object
org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManager
org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManagerImple

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

    • XTSATRecoveryManagerImple

      public XTSATRecoveryManagerImple(TxLog txLog)
      constructor for use by ATParticipantRecoveryModule and ATCoordinatorRecoveryModule
      Parameters:
      txLog -
  • Method Details

    • isRecoveryManagerInitialised

      public static boolean isRecoveryManagerInitialised()
    • registerRecoveryModule

      public void registerRecoveryModule(XTSATRecoveryModule module) throws NullPointerException
      register an application specific recovery module which acts as a helper to recreate a WS-AT durable participant from the participant's recovery data saved at prepare
      Specified by:
      registerRecoveryModule in class XTSATRecoveryManager
      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(XTSATRecoveryModule module) throws NoSuchElementException
      unregister an application specific recovery module previously registered as a helper to recretae WS-AT durable participants
      Specified by:
      unregisterRecoveryModule in class XTSATRecoveryManager
      Parameters:
      module - the module to be unregistered
      Throws:
      NoSuchElementException - if the module is not currently registered
    • writeParticipantRecoveryRecord

      public boolean writeParticipantRecoveryRecord(ATParticipantRecoveryRecord participantRecoveryRecord)
      save the supplied participant recovery record to persistent storage
      Specified by:
      writeParticipantRecoveryRecord in class XTSATRecoveryManager
      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 XTSATRecoveryManager
      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 XTSATRecoveryManager
      Parameters:
      uid -
    • addParticipantRecoveryRecord

      public void addParticipantRecoveryRecord(Uid uid, ATParticipantRecoveryRecord participantRecoveryRecord)
      add a recovered participant record to the table of unrecovered participants which need to be recreated following recovery
      Specified by:
      addParticipantRecoveryRecord in class XTSATRecoveryManager
      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 ATParticipantRecoveryRecord 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 XTSATRecoveryManager
      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 XTSATRecoveryManager
    • isParticipantRecoveryStarted

      public boolean isParticipantRecoveryStarted()
      test whether the first AT 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 XTSATRecoveryManager
    • isCoordinatorRecoveryStarted

      public boolean isCoordinatorRecoveryStarted()
      test whether the first AT coordinator recovery scan has completed. this indicates whether there may or may not still be unknown AT 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 XTSATRecoveryManager
    • isSubordinateCoordinatorRecoveryStarted

      public boolean isSubordinateCoordinatorRecoveryStarted()
      test whether the first AT subordinate coordinator recovery scan has completed. this indicates whether there may or may not still be unknown AT subtransaction records on disk. If the first scan has not yet completed then a commit for an unknown subtransaction must raise an exception delaying commit of the parent transaction.
      Specified by:
      isSubordinateCoordinatorRecoveryStarted in class XTSATRecoveryManager
    • setCoordinatorRecoveryStarted

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

      public void setSubordinateCoordinatorRecoveryStarted()
      record the fact that the first AT subordinate coordinator recovery scan has completed.
      Specified by:
      setSubordinateCoordinatorRecoveryStarted in class XTSATRecoveryManager