Search in sources :

Example 31 with SystemException

use of com.arjuna.mw.wsas.exceptions.SystemException in project narayana by jbosstm.

the class CoordinatorControl method createSubordinate.

/**
 * Create a subordinate transaction, i.e., one which can be driven
 * through complete, close and cancel. Such a transaction is not
 * interposed with any parent transaction because the parent may
 * be physically remote from the child. Such interposition is the
 * responsibility of the invoker.
 *
 * @return the subordinate transaction. The transaction is not
 * associated with the thread and is not interposed. It is running.
 *
 * @throws SystemException throw if any error occurs.
 */
public final BACoordinator createSubordinate() throws SystemException {
    try {
        SubordinateBACoordinator coord = new SubordinateBACoordinator();
        int status = coord.start(null);
        if (status != ActionStatus.RUNNING) {
            throw new BegunFailedException(wscfLogger.i18NLogger.get_model_sagas_arjunacore_CoordinatorControl_1() + ActionStatus.stringForm(status));
        } else {
            return coord;
        }
    } catch (SystemException ex) {
        throw ex;
    } catch (Exception ex) {
        throw new UnexpectedException(ex.toString());
    }
}
Also used : SubordinateBACoordinator(com.arjuna.mwlabs.wscf.model.sagas.arjunacore.subordinate.SubordinateBACoordinator) SystemException(com.arjuna.mw.wsas.exceptions.SystemException) SystemException(com.arjuna.mw.wsas.exceptions.SystemException) NoActivityException(com.arjuna.mw.wsas.exceptions.NoActivityException) WrongStateException(com.arjuna.mw.wsas.exceptions.WrongStateException) ProtocolViolationException(com.arjuna.mw.wsas.exceptions.ProtocolViolationException)

Example 32 with SystemException

use of com.arjuna.mw.wsas.exceptions.SystemException in project narayana by jbosstm.

the class CoordinatorControl method parentCoordinator.

private final ATCoordinator parentCoordinator() throws SystemException {
    try {
        ActivityHierarchy hier = UserActivityFactory.userActivity().currentActivity();
        ActivityHandleImple parentActivity = null;
        ATCoordinator parentCoordinator = null;
        if (hier.size() > 1) {
            parentActivity = (ActivityHandleImple) hier.activity(hier.size() - 2);
            parentCoordinator = (ATCoordinator) _coordinators.get(parentActivity);
        }
        return parentCoordinator;
    } catch (Exception ex) {
        ex.printStackTrace();
        return null;
    }
}
Also used : SubordinateATCoordinator(com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator) ActivityHierarchy(com.arjuna.mw.wsas.activity.ActivityHierarchy) ActivityHandleImple(com.arjuna.mwlabs.wsas.activity.ActivityHandleImple) SystemException(com.arjuna.mw.wsas.exceptions.SystemException) NoActivityException(com.arjuna.mw.wsas.exceptions.NoActivityException) WrongStateException(com.arjuna.mw.wsas.exceptions.WrongStateException) ProtocolViolationException(com.arjuna.mw.wsas.exceptions.ProtocolViolationException)

Aggregations

SystemException (com.arjuna.mw.wsas.exceptions.SystemException)32 NoActivityException (com.arjuna.mw.wsas.exceptions.NoActivityException)16 WrongStateException (com.arjuna.mw.wsas.exceptions.WrongStateException)16 ProtocolViolationException (com.arjuna.mw.wsas.exceptions.ProtocolViolationException)15 SubordinateATCoordinator (com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator)7 ActivityHierarchy (com.arjuna.mw.wsas.activity.ActivityHierarchy)6 HLS (com.arjuna.mw.wsas.activity.HLS)6 ProtocolNotRegisteredException (com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException)6 SubordinateBACoordinator (com.arjuna.mwlabs.wscf.model.sagas.arjunacore.subordinate.SubordinateBACoordinator)6 InvalidActivityException (com.arjuna.mw.wsas.exceptions.InvalidActivityException)5 InvalidTimeoutException (com.arjuna.mw.wsas.exceptions.InvalidTimeoutException)5 NoPermissionException (com.arjuna.mw.wsas.exceptions.NoPermissionException)5 ActivityImple (com.arjuna.mwlabs.wsas.activity.ActivityImple)5 InvalidCreateParametersException (com.arjuna.wsc.InvalidCreateParametersException)5 InvalidProtocolException (com.arjuna.wsc.InvalidProtocolException)5 SOAPContext (com.arjuna.mw.wsas.context.soap.SOAPContext)4 ActiveChildException (com.arjuna.mw.wsas.exceptions.ActiveChildException)4 ServiceRegistry (com.arjuna.webservices11.ServiceRegistry)4 EmptyStackException (java.util.EmptyStackException)4 Outcome (com.arjuna.mw.wsas.activity.Outcome)3