Search in sources :

Example 26 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext 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 });
    }
}
Also used : InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) CoordinatorCompletionCoordinatorInboundEvents(com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents)

Example 27 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext 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);
        }
    }
}
Also used : InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) SoapFault11(com.arjuna.webservices11.SoapFault11) MAP(org.jboss.ws.api.addressing.MAP) CoordinatorCompletionCoordinatorInboundEvents(com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents)

Example 28 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext 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());
    }
}
Also used : CoordinatorInboundEvents(com.arjuna.webservices11.wsat.CoordinatorInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier)

Example 29 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext 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());
    }
}
Also used : CoordinatorInboundEvents(com.arjuna.webservices11.wsat.CoordinatorInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier)

Example 30 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext 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);
        }
    }
}
Also used : SoapFault(com.arjuna.webservices.SoapFault) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) SoapFault11(com.arjuna.webservices11.SoapFault11) MAP(org.jboss.ws.api.addressing.MAP)

Aggregations

MAP (org.jboss.ws.api.addressing.MAP)95 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)83 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)74 MessageContext (javax.xml.ws.handler.MessageContext)68 Task (com.arjuna.services.framework.task.Task)62 Action (javax.xml.ws.Action)54 NotificationType (org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType)29 SoapFault (com.arjuna.webservices.SoapFault)17 Notification (org.oasis_open.docs.ws_tx.wsat._2006._06.Notification)15 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)13 SoapFault11 (com.arjuna.webservices11.SoapFault11)12 NotificationType (com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType)10 CoordinatorCompletionCoordinatorInboundEvents (com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents)10 CoordinatorCompletionParticipantInboundEvents (com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)10 ParticipantCompletionCoordinatorInboundEvents (com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents)10 ParticipantCompletionParticipantInboundEvents (com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents)9 State (com.arjuna.webservices11.wsba.State)9 ProtocolException (javax.xml.ws.ProtocolException)9 SystemException (com.arjuna.wst.SystemException)8 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)8