Class XTSBARecoveryManagerImple
java.lang.Object
org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager
org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManagerImple
A class which manages the table of recovered participant records.
-
Field Summary
Fields inherited from class org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager
lock, theRecoveryManager
-
Constructor Summary
ConstructorDescriptionXTSBARecoveryManagerImple
(TxLog txLog) constructor for use by BAParticipantRecoveryModule and BACoordinatorRecoveryModule -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParticipantRecoveryRecord
(Uid uid, BAParticipantRecoveryRecord participantRecoveryRecord) add a recovered participant record to the table of unrecovered participants which need to be recreated following recoveryboolean
remove any participant recovery record with the supplied id from persistent storagesee if a participant recovery record with a given id exists in the table of participants which need to be recreated following recoveryboolean
test whether the first BA coordinator recovery scan has completed.boolean
isParticipantPresent
(Uid uid) test whether the supplied uid identifies an active participant or a recovered but inactive participant n.b.boolean
test whether the first BA participant recovery scan has completed.static boolean
boolean
test whether the first BA subordinate coordinator recovery scan has completed.void
process all entries in the recovered participant map and attempt to recreate the application participant and activate itvoid
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 preparevoid
record the fact that the first BA coordinator recovery scan has completed.void
record the fact that the first BA subordinate coordinator recovery scan has completed.void
unregister an application specific recovery module previously registered as a helper to recretae WS-BA durable participantsboolean
writeParticipantRecoveryRecord
(BAParticipantRecoveryRecord participantRecoveryRecord) save the supplied participant recovery record to persistent storageMethods inherited from class org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager
getRecoveryManager, setRecoveryManager
-
Constructor Details
-
XTSBARecoveryManagerImple
constructor for use by BAParticipantRecoveryModule and BACoordinatorRecoveryModule- Parameters:
txLog
-
-
-
Method Details
-
isRecoveryManagerInitialised
public static boolean isRecoveryManagerInitialised() -
registerRecoveryModule
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 classXTSBARecoveryManager
- 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
unregister an application specific recovery module previously registered as a helper to recretae WS-BA durable participants- Specified by:
unregisterRecoveryModule
in classXTSBARecoveryManager
- 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 classXTSBARecoveryManager
- Parameters:
participantRecoveryRecord
-
-
deleteParticipantRecoveryRecord
remove any participant recovery record with the supplied id from persistent storage- Specified by:
deleteParticipantRecoveryRecord
in classXTSBARecoveryManager
- Parameters:
id
- the id of the participant whose recovery details are being deleted
-
isParticipantPresent
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 classXTSBARecoveryManager
- 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 classXTSBARecoveryManager
- Parameters:
uid
- the uid under which the participant was saved in the file storeparticipantRecoveryRecord
- the in-memory representation of the recovery record saved to disk
-
findParticipantRecoveryRecord
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 classXTSBARecoveryManager
- 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 classXTSBARecoveryManager
-
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 classXTSBARecoveryManager
-
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 classXTSBARecoveryManager
-
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 classXTSBARecoveryManager
-
setCoordinatorRecoveryStarted
public void setCoordinatorRecoveryStarted()record the fact that the first BA coordinator recovery scan has completed.- Specified by:
setCoordinatorRecoveryStarted
in classXTSBARecoveryManager
-
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 classXTSBARecoveryManager
-