use of com.arjuna.webservices11.wsarjtx.processors.TerminationParticipantProcessor in project narayana by jbosstm.
the class BusinessActivityTerminatorStub method close.
public void close() throws TransactionRolledBackException, UnknownTransactionException, SystemException {
final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId());
final RequestCallback callback = new RequestCallback();
final TerminationParticipantProcessor terminationParticipantProcessor = TerminationParticipantProcessor.getProcessor();
terminationParticipantProcessor.registerCallback(_id, callback);
try {
TerminationCoordinatorClient.getClient().sendClose(_terminationCoordinator, map, new InstanceIdentifier(_id));
callback.waitUntilTriggered();
} catch (final Throwable th) {
throw new SystemException();
} finally {
terminationParticipantProcessor.removeCallback(_id);
}
if (callback.hasTriggered()) {
if (callback.receivedClosed()) {
return;
}
final SoapFault soapFault = callback.getSoapFault();
if (soapFault != null) {
final QName subcode = soapFault.getSubcode();
if (ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(subcode)) {
throw new TransactionRolledBackException();
} else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode)) {
throw new UnknownTransactionException();
}
}
}
throw new SystemException();
}
use of com.arjuna.webservices11.wsarjtx.processors.TerminationParticipantProcessor in project narayana by jbosstm.
the class BusinessActivityTerminatorStub method cancel.
public void cancel() throws FaultedException, UnknownTransactionException, SystemException {
final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId());
final RequestCallback callback = new RequestCallback();
final TerminationParticipantProcessor terminationParticipantProcessor = TerminationParticipantProcessor.getProcessor();
terminationParticipantProcessor.registerCallback(_id, callback);
try {
TerminationCoordinatorClient.getClient().sendCancel(_terminationCoordinator, map, new InstanceIdentifier(_id));
callback.waitUntilTriggered();
} catch (final Throwable th) {
throw new SystemException();
} finally {
terminationParticipantProcessor.removeCallback(_id);
}
if (callback.hasTriggered()) {
if (callback.receivedCancelled()) {
return;
} else if (callback.receivedFaulted()) {
throw new FaultedException();
}
final SoapFault soapFault = callback.getSoapFault();
if (soapFault != null) {
final QName subcode = soapFault.getSubcode();
if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode)) {
throw new UnknownTransactionException();
}
}
}
throw new SystemException();
}
use of com.arjuna.webservices11.wsarjtx.processors.TerminationParticipantProcessor in project narayana by jbosstm.
the class BusinessActivityTerminatorStub method complete.
public void complete() throws FaultedException, UnknownTransactionException, SystemException {
final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId());
final RequestCallback callback = new RequestCallback();
final TerminationParticipantProcessor terminationParticipantProcessor = TerminationParticipantProcessor.getProcessor();
terminationParticipantProcessor.registerCallback(_id, callback);
try {
TerminationCoordinatorClient.getClient().sendComplete(_terminationCoordinator, map, new InstanceIdentifier(_id));
callback.waitUntilTriggered();
} catch (final Throwable th) {
throw new SystemException();
} finally {
terminationParticipantProcessor.removeCallback(_id);
}
if (callback.hasTriggered()) {
if (callback.receivedCompleted()) {
return;
} else if (callback.receivedFaulted()) {
throw new FaultedException();
}
final SoapFault soapFault = callback.getSoapFault();
if (soapFault != null) {
final QName subcode = soapFault.getSubcode();
if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode)) {
throw new UnknownTransactionException();
}
}
}
throw new SystemException();
}
Aggregations