Package com.arjuna.wst11.stub
Class SubordinateDurable2PCStub
java.lang.Object
com.arjuna.wst11.stub.SubordinateDurable2PCStub
- All Implemented Interfaces:
Durable2PCParticipant
,Participant
,PersistableParticipant
,PersistableATParticipant
public class SubordinateDurable2PCStub
extends Object
implements Durable2PCParticipant, PersistableParticipant, PersistableATParticipant
A durable participant registered on behalf of an interposed WS-AT coordinator in order to ensure that
durable participants in the subtransaction prepared, committed and aborted at the right time.
-
Constructor Summary
ConstructorDescriptionempty constructor for use only during recoverySubordinateDurable2PCStub
(com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator coordinator) normal constructor used when the subordinate coordinator is registered as a durable participant with its parent coordinator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
this will be called when the parent coordinator commits its durable participants and should ensure that the interposed cooordinator does the samevoid
error()
this should never get calledbyte[]
this participant implements the PersistableATarticipant interface so it can save its state.boolean
test if this participant is recoveredprepare()
This will be called when the parent coordinator is preparing its durable participants and should ensure that the interposed cooordinator does the same.boolean
Restore the state of the particpant from the specified input object stream.void
rollback()
this will be called when the parent coordinator rolls back its durable participants and should ensure that the interposed cooordinator does the sameboolean
Save the state of the particpant to the specified input object stream.void
unknown()
this should never get called
-
Constructor Details
-
SubordinateDurable2PCStub
public SubordinateDurable2PCStub(com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator coordinator) normal constructor used when the subordinate coordinator is registered as a durable participant with its parent coordinator.- Parameters:
coordinator
-
-
SubordinateDurable2PCStub
public SubordinateDurable2PCStub()empty constructor for use only during recovery
-
-
Method Details
-
prepare
This will be called when the parent coordinator is preparing its durable participants and should ensure that the interposed cooordinator does the same.- Specified by:
prepare
in interfaceParticipant
- Returns:
- the Vote returned by the subordinate coordinator.
- Throws:
WrongStateException
- if the subordinate coordinator does the sameSystemException
- if the subordinate coordinator does the same- See Also:
-
commit
this will be called when the parent coordinator commits its durable participants and should ensure that the interposed cooordinator does the same- Specified by:
commit
in interfaceParticipant
- Throws:
WrongStateException
SystemException
-
rollback
this will be called when the parent coordinator rolls back its durable participants and should ensure that the interposed cooordinator does the same- Specified by:
rollback
in interfaceParticipant
- Throws:
WrongStateException
SystemException
-
unknown
this should never get called- Specified by:
unknown
in interfaceParticipant
- Throws:
SystemException
-
error
this should never get called- Specified by:
error
in interfaceParticipant
- Throws:
SystemException
-
saveState
Save the state of the particpant to the specified input object stream.- Specified by:
saveState
in interfacePersistableParticipant
- Parameters:
oos
- The output output stream.- Returns:
- true if persisted, false otherwise.
-
restoreState
Restore the state of the particpant from the specified input object stream.- Specified by:
restoreState
in interfacePersistableParticipant
- Parameters:
ios
- The Input object stream.- Returns:
- true if restored, false otherwise.
-
isRecovered
public boolean isRecovered()test if this participant is recovered -
getRecoveryState
this participant implements the PersistableATarticipant interface so it can save its state. recovery is managed by an XTS recovery module- Specified by:
getRecoveryState
in interfacePersistableATParticipant
- Returns:
- the recover state for the stub
- Throws:
Exception
-