Search in sources :

Example 1 with ParticipantCompletionParticipantInboundEvents

use of com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents in project narayana by jbosstm.

the class ParticipantCompletionParticipantProcessorImpl 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 ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    if (participant != null) {
        try {
            participant.getStatus(getStatus, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from getStatus:", th);
            }
        }
    } else {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("GetStatus called on unknown participant: {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_ParticipantCompletionParticipantProcessorImpl_getStatus_4());
            ParticipantCompletionCoordinatorClient.getClient().sendSoapFault(soapFault, null, faultMAP, getFaultAction());
        } catch (final Throwable th) {
            WSTLogger.i18NLogger.info_wst11_messaging_ParticipantCompletionParticipantProcessorImpl_getStatus_3(instanceIdentifier.toString(), th);
        }
    }
}
Also used : ParticipantCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) SoapFault11(com.arjuna.webservices11.SoapFault11) MAP(org.jboss.ws.api.addressing.MAP)

Example 2 with ParticipantCompletionParticipantInboundEvents

use of com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents in project narayana by jbosstm.

the class ParticipantCompletionParticipantProcessorImpl method failed.

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

Example 3 with ParticipantCompletionParticipantInboundEvents

use of com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents in project narayana by jbosstm.

the class ParticipantCompletionParticipantProcessorImpl 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_ParticipantCompletionParticipantProcessorImpl_close_3(instanceIdentifier.toString());
        return;
    }
    final ParticipantCompletionParticipantInboundEvents 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_ParticipantCompletionParticipantProcessorImpl_close_4(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantCompletionParticipantProcessorImpl_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) ParticipantCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier)

Example 4 with ParticipantCompletionParticipantInboundEvents

use of com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents in project narayana by jbosstm.

the class ParticipantCompletionParticipantProcessorImpl 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_ParticipantCompletionParticipantProcessorImpl_compensate_3(instanceIdentifier.toString());
        return;
    }
    final ParticipantCompletionParticipantInboundEvents 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_ParticipantCompletionParticipantProcessorImpl_compensate_4(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantCompletionParticipantProcessorImpl_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) ParticipantCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier)

Example 5 with ParticipantCompletionParticipantInboundEvents

use of com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents in project narayana by jbosstm.

the class ParticipantCompletionParticipantProcessorImpl method cancel.

/**
 * Cancel.
 * @param cancel The cancel notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void cancel(final NotificationType cancel, 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_ParticipantCompletionParticipantProcessorImpl_cancel_3(instanceIdentifier.toString());
        return;
    }
    final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    if (participant != null) {
        try {
            participant.cancel(cancel, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from cancel:", th);
            }
        }
    } else if (!recoveryManager.isParticipantRecoveryStarted()) {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantCompletionParticipantProcessorImpl_cancel_4(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_ParticipantCompletionParticipantProcessorImpl_cancel_5(instanceIdentifier.toString());
    } else {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("Cancel called on unknown participant: {0}", new Object[] { instanceIdentifier });
        }
        sendCancelled(map, arjunaContext);
    }
}
Also used : XTSBARecoveryManager(org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager) ParticipantCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier)

Aggregations

InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)9 ParticipantCompletionParticipantInboundEvents (com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents)9 XTSBARecoveryManager (org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager)3 SoapFault11 (com.arjuna.webservices11.SoapFault11)1 MAP (org.jboss.ws.api.addressing.MAP)1