use of com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant in project narayana by jbosstm.
the class BAParticipantRecoveryRecord method activate.
/**
* create a participant engine to manage commit or rollback processing for the
* participant and install it in the active participants table
*/
public void activate() {
if (isParticipantCompletion) {
ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, endpoint, participant, State.STATE_COMPLETED, true);
ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, getId());
engine.recovery();
} else {
BusinessAgreementWithCoordinatorCompletionParticipant coordinatorCompletionParticipant = (BusinessAgreementWithCoordinatorCompletionParticipant) participant;
CoordinatorCompletionParticipantEngine engine = new CoordinatorCompletionParticipantEngine(id, endpoint, coordinatorCompletionParticipant, State.STATE_COMPLETED, true);
CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, getId());
engine.recovery();
}
}
use of com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant in project narayana by jbosstm.
the class XTSBASubordinateRecoveryModule method recreateCoordinatorCompletionParticipant.
public BusinessAgreementWithCoordinatorCompletionParticipant recreateCoordinatorCompletionParticipant(String id, byte[] recoveryState) throws Exception {
if (id.startsWith(SubordinateBACoordinator.PARTICIPANT_PREFIX)) {
if (!id.endsWith("_CCP")) {
// throw an exception because we don't expect participant completion participants at present
throw new Exception("XTSBASubordinateRecoveryModule : invalid name for subordinate WS-BA coordinator coordinator completion participant participant " + id);
}
// ok, try to recreate the participant
InputObjectState ios = new InputObjectState();
ios.setBuffer(recoveryState);
String className = ios.unpackString();
Class participantClass = this.getClass().getClassLoader().loadClass(className);
BusinessAgreementWithCoordinatorCompletionParticipant participant = (BusinessAgreementWithCoordinatorCompletionParticipant) participantClass.newInstance();
((PersistableParticipant) participant).restoreState(ios);
return participant;
}
return null;
}
use of com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant in project narayana by jbosstm.
the class TestBARecoveryModule method deserializeCoordinatorCompletionParticipant.
public BusinessAgreementWithCoordinatorCompletionParticipant deserializeCoordinatorCompletionParticipant(String id, ObjectInputStream stream) throws Exception {
if (id.startsWith(Constants.PARTICIPANT_ID_PREFIX + "CoordinatorCompletionParticipant")) {
System.out.println("xts service test : attempting to deserialize WS-BA coordinator completion participant " + id);
BusinessAgreementWithCoordinatorCompletionParticipant participant = (BusinessAgreementWithCoordinatorCompletionParticipant) stream.readObject();
System.out.println("xts service test : deserialized WS-BA coordinator completion participant " + id);
return participant;
}
return null;
}
Aggregations