Search in sources :

Example 96 with InstanceIdentifier

use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.

the class ParticipantProcessorImpl method prepare.

/**
 * Prepare.
 * @param prepare The prepare notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void prepare(final Notification prepare, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    final ParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    if (participant != null) {
        try {
            participant.prepare(prepare, map, arjunaContext);
        } catch (final Throwable th) {
            WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_prepare_1(th);
        }
    } else {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_prepare_2(instanceIdentifier.toString());
        sendAborted(map, arjunaContext);
    }
}
Also used : InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) ParticipantInboundEvents(com.arjuna.webservices11.wsat.ParticipantInboundEvents)

Example 97 with InstanceIdentifier

use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.

the class ParticipantProcessorImpl method rollback.

/**
 * Rollback.
 * @param rollback The rollback notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void rollback(final Notification rollback, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    /**
     * ensure the AT participant recovery manager is running
     */
    XTSATRecoveryManager recoveryManager = XTSATRecoveryManager.getRecoveryManager();
    if (recoveryManager == null) {
        // log warning and drop this message -- it will be resent
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_rollback_3(instanceIdentifier.toString());
    }
    final ParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    if (participant != null) {
        try {
            participant.rollback(rollback, map, arjunaContext);
        } catch (final Throwable th) {
            WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_rollback_1(th);
        }
    } else if (!recoveryManager.isParticipantRecoveryStarted()) {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_rollback_4(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_rollback_5(instanceIdentifier.toString());
    } else {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_rollback_2(instanceIdentifier.toString());
        sendAborted(map, arjunaContext);
    }
}
Also used : XTSATRecoveryManager(org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManager) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) ParticipantInboundEvents(com.arjuna.webservices11.wsat.ParticipantInboundEvents)

Example 98 with InstanceIdentifier

use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.

the class ParticipantProcessorImpl method commit.

/**
 * Commit.
 * @param commit The commit notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void commit(final Notification commit, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    /**
     * ensure the AT participant recovery manager is running
     */
    XTSATRecoveryManager recoveryManager = XTSATRecoveryManager.getRecoveryManager();
    if (recoveryManager == null) {
        // log warning and drop this message -- it will be resent
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_commit_3(instanceIdentifier.toString());
        return;
    }
    final ParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    if (participant != null) {
        try {
            participant.commit(commit, map, arjunaContext);
        } catch (final Throwable th) {
            WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_commit_1(th);
        }
    } else if (!recoveryManager.isParticipantRecoveryStarted()) {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_commit_4(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_commit_5(instanceIdentifier.toString());
    } else {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_commit_2(instanceIdentifier.toString());
        sendCommitted(map, arjunaContext);
    }
}
Also used : XTSATRecoveryManager(org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManager) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) ParticipantInboundEvents(com.arjuna.webservices11.wsat.ParticipantInboundEvents)

Example 99 with InstanceIdentifier

use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.

the class ParticipantProcessorImpl method sendAborted.

/**
 * Send an aborted message.
 *
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
private void sendAborted(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().sendAborted(null, responseMAP, instanceIdentifier);
    } catch (final Throwable th) {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("Unexpected exception while sending Aborted", th);
        }
    }
}
Also used : InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP)

Example 100 with InstanceIdentifier

use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.

the class ParticipantProcessorImpl 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 ParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    if (participant != null) {
        try {
            participant.soapFault(fault, map, arjunaContext);
        } catch (final Throwable th) {
            WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_soapFault_1(th);
        }
    } else {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantProcessorImpl_soapFault_2(instanceIdentifier.toString());
    }
}
Also used : InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) ParticipantInboundEvents(com.arjuna.webservices11.wsat.ParticipantInboundEvents)

Aggregations

InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)130 MAP (org.jboss.ws.api.addressing.MAP)83 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)53 Test (org.junit.Test)51 SoapFault11 (com.arjuna.webservices11.SoapFault11)24 SoapFault (com.arjuna.webservices.SoapFault)20 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)13 SystemException (com.arjuna.wst.SystemException)13 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)13 QName (javax.xml.namespace.QName)12 CoordinatorCompletionCoordinatorInboundEvents (com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents)10 CoordinatorCompletionParticipantInboundEvents (com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)10 ParticipantCompletionCoordinatorInboundEvents (com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents)10 CoordinatorCompletionParticipantDetails (com.arjuna.wst.tests.arq.TestCoordinatorCompletionParticipantProcessor.CoordinatorCompletionParticipantDetails)10 ParticipantCompletionCoordinatorDetails (com.arjuna.wst.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails)10 SoapFaultType (com.arjuna.webservices.SoapFaultType)9 ParticipantCompletionParticipantInboundEvents (com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents)9 CoordinatorCompletionCoordinatorDetails (com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails)9 ParticipantCompletionParticipantDetails (com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails)9 ProtocolException (javax.xml.ws.ProtocolException)9