use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.
the class CoordinatorCompletionCoordinatorProcessorImpl method getStatus.
/**
* Get Status.
* @param getStatus The get status notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void getStatus(final NotificationType getStatus, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
if (coordinator != null) {
try {
coordinator.getStatus(getStatus, map, arjunaContext);
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from getStatus:", th);
}
}
} else if (!areRecoveryLogEntriesAccountedFor()) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("GetStatus dropped for unknown coordinator completion participant {0} while waiting on recovery scan", new Object[] { instanceIdentifier });
}
} else {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("GetStatus called on unknown coordinator: {0}", new Object[] { instanceIdentifier });
}
// send an invalid state fault
final String messageId = MessageId.getMessageId();
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
try {
final SoapFault11 soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_CoordinatorCompletionCoordinatorProcessorImpl_getStatus_4());
CoordinatorCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, faultMAP, getFaultAction());
} catch (final Throwable th) {
WSTLogger.i18NLogger.info_wst11_messaging_CoordinatorCompletionCoordinatorProcessorImpl_getStatus_3(instanceIdentifier.toString(), th);
}
}
}
use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.
the class CoordinatorProcessorImpl method sendUnknownTransaction.
/**
* Send an unknown transaction fault.
*
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
private void sendUnknownTransaction(final MAP map, final ArjunaContext arjunaContext) {
// KEV add check for recovery
final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, MessageId.getMessageId());
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
try {
final String message = WSTLogger.i18NLogger.get_wst11_messaging_CoordinatorProcessorImpl_sendUnknownTransaction_1();
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, AtomicTransactionConstants.WSAT_ERROR_CODE_UNKNOWN_TRANSACTION_QNAME, message);
ParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier);
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpecting exception while sending InvalidState", th);
}
}
}
use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.
the class ParticipantCompletionParticipantProcessorImpl method getStatus.
/**
* Get Status.
* @param getStatus The get status notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void getStatus(final NotificationType getStatus, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier);
if (participant != null) {
try {
participant.getStatus(getStatus, map, arjunaContext);
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from getStatus:", th);
}
}
} else {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("GetStatus called on unknown participant: {0}", new Object[] { instanceIdentifier });
}
// send an invalid state fault
final String messageId = MessageId.getMessageId();
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
try {
final SoapFault11 soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_ParticipantCompletionParticipantProcessorImpl_getStatus_4());
ParticipantCompletionCoordinatorClient.getClient().sendSoapFault(soapFault, null, faultMAP, getFaultAction());
} catch (final Throwable th) {
WSTLogger.i18NLogger.info_wst11_messaging_ParticipantCompletionParticipantProcessorImpl_getStatus_3(instanceIdentifier.toString(), th);
}
}
}
use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.
the class TerminationCoordinatorProcessorImpl method cancel.
/**
* Cancel.
* @param cancel The cancel notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void cancel(final NotificationType cancel, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final BusinessActivityTerminator participant = getParticipant(instanceIdentifier);
try {
if (participant != null) {
W3CEndpointReference endpoint = participant.getEndpoint();
final String messageId = MessageId.getMessageId();
try {
participant.cancel();
} catch (final FaultedException fe) {
final MAP responseMAP = AddressingHelper.createNotificationContext(messageId);
TerminationParticipantClient.getClient().sendFaulted(endpoint, responseMAP, instanceIdentifier);
} catch (final UnknownTransactionException ute) {
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_1());
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
} catch (final SystemException se) {
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final String message = WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_2();
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message);
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from cancel:", th);
}
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final SoapFault soapFault = new SoapFault11(th);
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
}
final MAP responseMAP = AddressingHelper.createNotificationContext(messageId);
TerminationParticipantClient.getClient().sendCancelled(endpoint, responseMAP, instanceIdentifier);
} else {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Cancel called on unknown participant: {0}", new Object[] { instanceIdentifier });
}
final MAP faultMAP = AddressingHelper.createFaultContext(map, MessageId.getMessageId());
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_5());
TerminationParticipantClient.getClient().sendSoapFault(soapFault, faultMAP, instanceIdentifier);
}
} catch (Throwable throwable) {
throwable.printStackTrace(System.err);
}
}
use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.
the class TerminationCoordinatorProcessorImpl method complete.
/**
* Complete.
* @param complete The complete notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void complete(final NotificationType complete, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final BusinessActivityTerminator participant = getParticipant(instanceIdentifier);
try {
if (participant != null) {
W3CEndpointReference endpoint = participant.getEndpoint();
final String messageId = MessageId.getMessageId();
try {
participant.complete();
} catch (final FaultedException fe) {
final MAP responseMAP = AddressingHelper.createNotificationContext(messageId);
TerminationParticipantClient.getClient().sendFaulted(endpoint, responseMAP, instanceIdentifier);
} catch (final UnknownTransactionException ute) {
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_12());
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
} catch (final SystemException se) {
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final String message = WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_13();
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message);
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from complete:", th);
}
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final SoapFault soapFault = new SoapFault11(th);
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
}
final MAP responseMAP = AddressingHelper.createNotificationContext(messageId);
TerminationParticipantClient.getClient().sendCompleted(endpoint, responseMAP, instanceIdentifier);
} else {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Complete called on unknown participant: {0}", new Object[] { instanceIdentifier });
}
final MAP faultMAP = AddressingHelper.createFaultContext(map, MessageId.getMessageId());
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_16());
TerminationParticipantClient.getClient().sendSoapFault(soapFault, faultMAP, instanceIdentifier);
}
} catch (Throwable throwable) {
throwable.printStackTrace(System.err);
}
}
Aggregations