use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class ParticipantCompletionCoordinatorProcessorImpl 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 ParticipantCompletionCoordinatorInboundEvents 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_ParticipantCompletionCoordinatorProcessorImpl_getStatus_4());
AddressingHelper.installNoneReplyTo(faultMAP);
ParticipantCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, faultMAP, getFaultAction());
} catch (final Throwable th) {
WSTLogger.i18NLogger.info_wst11_messaging_ParticipantCompletionCoordinatorProcessorImpl_getStatus_3(instanceIdentifier.toString(), th);
}
}
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class ParticipantCompletionCoordinatorProcessorImpl method exit.
/**
* Exit.
* @param exit The exit notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void exit(final NotificationType exit, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
if (coordinator != null) {
try {
coordinator.exit(exit, map, arjunaContext);
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from exit:", th);
}
}
} else {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Exit called on unknown coordinator: {0}", new Object[] { instanceIdentifier });
}
sendExited(map, arjunaContext);
}
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class ParticipantCompletionCoordinatorProcessorImpl method compensated.
/**
* Compensated.
* @param compensated The compensated notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void compensated(final NotificationType compensated, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
if (coordinator != null) {
try {
coordinator.compensated(compensated, map, arjunaContext);
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from compensated:", th);
}
}
} else if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Compensated called on unknown coordinator: {0}", new Object[] { instanceIdentifier });
}
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class ParticipantProcessorImpl method sendCommitted.
/**
* Send a committed message.
*
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
private void sendCommitted(final MAP map, final ArjunaContext arjunaContext) {
// KEV add check for recovery
final String messageId = MessageId.getMessageId();
final MAP responseMAP = AddressingHelper.createResponseContext(map, messageId);
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
try {
CoordinatorClient.getClient().sendCommitted(null, responseMAP, instanceIdentifier);
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception while sending Committed", th);
}
}
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class TerminationCoordinatorRPCProcessorImpl 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 = TerminationCoordinatorProcessor.getProcessor().getParticipant(instanceIdentifier);
try {
if (participant != null) {
W3CEndpointReference endpoint = participant.getEndpoint();
final String messageId = MessageId.getMessageId();
try {
participant.complete();
} catch (FaultedException fm) {
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_RECEIVER.getValue(), ArjunaTXConstants.FAULTED_ERROR_CODE_QNAME);
throw new SOAPFaultException(soapFault);
} catch (final UnknownTransactionException ute) {
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME);
soapFault.addDetail().addDetailEntry(ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME).addTextNode(WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_12());
throw new SOAPFaultException(soapFault);
} catch (final SystemException se) {
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_RECEIVER.getValue(), ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME);
soapFault.addDetail().addDetailEntry(ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME).addTextNode(WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_13());
throw new SOAPFaultException(soapFault);
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from close:", th);
}
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_RECEIVER.getValue(), ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME);
soapFault.addDetail().addDetailEntry(ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME).addTextNode(WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_13());
throw new SOAPFaultException(soapFault);
}
} else {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Complete called on unknown participant: {0}", new Object[] { instanceIdentifier });
}
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME);
soapFault.addDetail().addDetailEntry(ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME).addTextNode(WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_12());
throw new SOAPFaultException(soapFault);
}
} catch (SOAPException se) {
se.printStackTrace(System.err);
throw new ProtocolException(se);
}
}
Aggregations