Search in sources :

Example 1 with CoordinatorCompletionParticipantInboundEvents

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

the class CoordinatorCompletionParticipantProcessorImpl 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_CoordinatorCompletionParticipantProcessorImpl_cancel_3(instanceIdentifier.toString());
        return;
    }
    final CoordinatorCompletionParticipantInboundEvents 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_CoordinatorCompletionParticipantProcessorImpl_cancel_4(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_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) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) CoordinatorCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)

Example 2 with CoordinatorCompletionParticipantInboundEvents

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

the class CoordinatorCompletionParticipantProcessorImpl method status.

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

Example 3 with CoordinatorCompletionParticipantInboundEvents

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

the class CoordinatorCompletionParticipantProcessorImpl 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 CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier);
    /**
     * 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_complete_4(instanceIdentifier.toString());
        return;
    }
    if (participant != null) {
        try {
            participant.complete(complete, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from complete:", th);
            }
        }
    } else if (!recoveryManager.isParticipantRecoveryStarted()) {
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_complete_5(instanceIdentifier.toString());
    } else if (recoveryManager.findParticipantRecoveryRecord(instanceIdentifier.getInstanceIdentifier()) != null) {
        WSTLogger.i18NLogger.warn_wst11_messaging_CoordinatorCompletionParticipantProcessorImpl_complete_6(instanceIdentifier.toString());
    } else {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("Complete called on unknown participant: {0}", new Object[] { instanceIdentifier });
        }
        sendFail(map, arjunaContext, State.STATE_ENDED.getValue());
    }
}
Also used : XTSBARecoveryManager(org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) CoordinatorCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)

Example 4 with CoordinatorCompletionParticipantInboundEvents

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

the class CoordinatorCompletionParticipantProcessorImpl 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 CoordinatorCompletionParticipantInboundEvents 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}", instanceIdentifier);
    }
}
Also used : InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) CoordinatorCompletionParticipantInboundEvents(com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)

Example 5 with CoordinatorCompletionParticipantInboundEvents

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

the class CoordinatorCompletionParticipantProcessorImpl method exited.

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

Aggregations

InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)10 CoordinatorCompletionParticipantInboundEvents (com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)10 XTSBARecoveryManager (org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager)4 SoapFault11 (com.arjuna.webservices11.SoapFault11)1 MAP (org.jboss.ws.api.addressing.MAP)1