Search in sources :

Example 91 with InstanceIdentifier

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

the class CoordinatorCompletionParticipantProcessorImpl method close.

/**
 * Close.
 * @param close The close notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void close(final NotificationType close, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    /**
     * ensure the BA participant recovery manager is running
     */
    XTSBARecoveryManager recoveryManager = XTSBARecoveryManager.getRecoveryManager();
    if (recoveryManager == null) {
        // log warning and drop this message -- it will be resent
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_close_3(instanceIdentifier.toString());
        return;
    }
    final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    if (participant != null) {
        try {
            participant.close(close, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from close:", th);
            }
        }
    } else if (!recoveryManager.isParticipantRecoveryStarted()) {
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_close_4(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_close_5(instanceIdentifier.toString());
    } else {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("Close called on unknown participant: {0}", new Object[] { instanceIdentifier });
        }
        sendClosed(map, arjunaContext);
    }
}
Also used : XTSBARecoveryManager(org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) CoordinatorCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)

Example 92 with InstanceIdentifier

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

the class CoordinatorCompletionParticipantProcessorImpl method compensate.

/**
 * Compensate.
 * @param compensate The compensate notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void compensate(final NotificationType compensate, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    /**
     * ensure the BA participant recovery manager is running
     */
    XTSBARecoveryManager recoveryManager = XTSBARecoveryManager.getRecoveryManager();
    if (recoveryManager == null) {
        // log warning and drop this message -- it will be resent
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_compensate_3(instanceIdentifier.toString());
        return;
    }
    final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    if (participant != null) {
        try {
            participant.compensate(compensate, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from compensate:", th);
            }
        }
    } else if (!recoveryManager.isParticipantRecoveryStarted()) {
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_compensate_4(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_compensate_5(instanceIdentifier.toString());
    } else {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("Compensate called on unknown participant: {0}", new Object[] { instanceIdentifier });
        }
        sendCompensated(map, arjunaContext);
    }
}
Also used : XTSBARecoveryManager(org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) CoordinatorCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)

Example 93 with InstanceIdentifier

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

the class ParticipantCompletionCoordinatorProcessorImpl method soapFault.

/**
 * SOAP fault.
 * @param soapFault The SOAP fault.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void soapFault(final SoapFault soapFault, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
    if (coordinator != null) {
        try {
            coordinator.soapFault(soapFault, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from soapFault:", th);
            }
        }
    } else if (WSTLogger.logger.isTraceEnabled()) {
        WSTLogger.logger.tracev("SoapFault called on unknown coordinator: {0}", new Object[] { instanceIdentifier });
    }
}
Also used : ParticipantCompletionCoordinatorInboundEvents(com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier)

Example 94 with InstanceIdentifier

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

the class ParticipantCompletionCoordinatorProcessorImpl method completed.

/**
 * Completed.
 * @param completed The completed notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void completed(final NotificationType completed, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
    if (coordinator != null) {
        try {
            coordinator.completed(completed, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from completed:", th);
            }
        }
    } else if (WSTLogger.logger.isTraceEnabled()) {
        if (areRecoveryLogEntriesAccountedFor()) {
            // this is a resend for a lost participant
            WSTLogger.logger.tracev("Completed called on unknown coordinator: {0}", new Object[] { instanceIdentifier });
        } else {
            // this may be a resend for a participant still pending recovery
            WSTLogger.logger.tracev("Ignoring completed called on unidentified coordinator until recovery pass is complete: {0}", new Object[] { instanceIdentifier });
        }
    }
}
Also used : ParticipantCompletionCoordinatorInboundEvents(com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier)

Example 95 with InstanceIdentifier

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

the class ParticipantCompletionCoordinatorProcessorImpl method fail.

/**
 * Fail.
 * @param fail The fail notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void fail(final ExceptionType fail, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
    if (coordinator != null) {
        try {
            coordinator.fail(fail, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from fail:", th);
            }
        }
    } else if (areRecoveryLogEntriesAccountedFor()) {
        // we can respond with a failed as the participant is not pending recovery
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("Fail called on unknown coordinator: {0}", new Object[] { instanceIdentifier });
        }
        sendFailed(map, arjunaContext);
    } else {
        // we must delay responding until we can be sure there is no participant pending recovery
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("Ignoring fail called on unidentified coordinator until recovery pass is complete: {0}", new Object[] { instanceIdentifier });
        }
    }
}
Also used : ParticipantCompletionCoordinatorInboundEvents(com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier)

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