Class XTSATRecoveryManagerImple
java.lang.Object
org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManager
org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManagerImple
A class which manages the table of recovered participant records.
-
Field Summary
Fields inherited from class org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManager
lock, theRecoveryManager
-
Constructor Summary
ConstructorDescriptionXTSATRecoveryManagerImple
(TxLog txLog) constructor for use by ATParticipantRecoveryModule and ATCoordinatorRecoveryModule -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParticipantRecoveryRecord
(Uid uid, ATParticipantRecoveryRecord 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 AT 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 AT participant recovery scan has completed.static boolean
boolean
test whether the first AT 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-AT durable participant from the participant's recovery data saved at preparevoid
record the fact that the first AT coordinator recovery scan has completed.void
record the fact that the first AT subordinate coordinator recovery scan has completed.void
unregister an application specific recovery module previously registered as a helper to recretae WS-AT durable participantsboolean
writeParticipantRecoveryRecord
(ATParticipantRecoveryRecord participantRecoveryRecord) save the supplied participant recovery record to persistent storageMethods inherited from class org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManager
getRecoveryManager, setRecoveryManager
-
Constructor Details
-
XTSATRecoveryManagerImple
constructor for use by ATParticipantRecoveryModule and ATCoordinatorRecoveryModule- 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-AT durable participant from the participant's recovery data saved at prepare- Specified by:
registerRecoveryModule
in classXTSATRecoveryManager
- 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-AT durable participants- Specified by:
unregisterRecoveryModule
in classXTSATRecoveryManager
- 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 classXTSATRecoveryManager
- Parameters:
participantRecoveryRecord
-
-
deleteParticipantRecoveryRecord
remove any participant recovery record with the supplied id from persistent storage- Specified by:
deleteParticipantRecoveryRecord
in classXTSATRecoveryManager
- 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 classXTSATRecoveryManager
- 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 classXTSATRecoveryManager
- 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 classXTSATRecoveryManager
- 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 classXTSATRecoveryManager
-
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 classXTSATRecoveryManager
-
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 classXTSATRecoveryManager
-
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 classXTSATRecoveryManager
-
setCoordinatorRecoveryStarted
public void setCoordinatorRecoveryStarted()record the fact that the first AT coordinator recovery scan has completed.- Specified by:
setCoordinatorRecoveryStarted
in classXTSATRecoveryManager
-
setSubordinateCoordinatorRecoveryStarted
public void setSubordinateCoordinatorRecoveryStarted()record the fact that the first AT subordinate coordinator recovery scan has completed.- Specified by:
setSubordinateCoordinatorRecoveryStarted
in classXTSATRecoveryManager
-