use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class CoordinatorCompletionCoordinatorProcessorImpl method cancelled.
/**
* Cancelled.
* @param cancelled The canceled notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void cancelled(final NotificationType cancelled, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
if (coordinator != null) {
try {
coordinator.cancelled(cancelled, map, arjunaContext);
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from cancelled:", th);
}
}
} else if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Cancelled called on unknown coordinator: {0}", new Object[] { instanceIdentifier });
}
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier 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.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class CoordinatorProcessorImpl method soapFault.
/**
* SOAP Fault.
* @param fault The SOAP fault notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void soapFault(final SoapFault fault, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final CoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
if (coordinator != null) {
try {
coordinator.soapFault(fault, map, arjunaContext);
} catch (final Throwable th) {
WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorProcessorImpl_soapFault_1(th);
}
} else {
WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorProcessorImpl_soapFault_2(instanceIdentifier.toString());
}
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class CoordinatorProcessorImpl method prepared.
/**
* Prepared.
* @param prepared The prepared notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void prepared(final Notification prepared, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final CoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
if (coordinator != null) {
try {
coordinator.prepared(prepared, map, arjunaContext);
} catch (final Throwable th) {
WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorProcessorImpl_prepared_1(th);
}
} else if (areRecoveryLogEntriesAccountedFor()) {
WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorProcessorImpl_prepared_2(instanceIdentifier.toString());
final String identifierValue = instanceIdentifier.getInstanceIdentifier();
if ((identifierValue != null) && (identifierValue.length() > 0) && (identifierValue.charAt(0) == 'D')) {
sendRollback(map, arjunaContext);
} else {
sendUnknownTransaction(map, arjunaContext);
}
} else {
// there may be a participant stub waiting to be recovered from the log so drop the
// message, forcing the caller to retry
WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorProcessorImpl_prepared_3(instanceIdentifier.toString());
}
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier 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);
}
}
}
Aggregations