Search in sources :

Example 11 with SystemException

use of com.arjuna.wst.SystemException in project narayana by jbosstm.

the class BusinessActivityTerminatorImple method cancel.

public void cancel() throws UnknownTransactionException, SystemException {
    try {
        if (_hier == null)
            throw new UnknownTransactionException();
        _coordManager.resume(_hier);
        _coordManager.cancel();
    } catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex) {
        throw new UnknownTransactionException();
    } catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex) {
        throw new SystemException(ex.toString());
    } catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex) {
        throw new SystemException(ex.toString());
    } catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex) {
        throw new SystemException(ex.toString());
    } catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorConfirmedException ex) {
        throw new SystemException(ex.toString());
    } catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex) {
        throw new UnknownTransactionException();
    } catch (com.arjuna.mw.wsas.exceptions.SystemException ex) {
        throw new SystemException();
    } catch (UnknownTransactionException ex) {
        throw ex;
    } finally {
        TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this);
    }
}
Also used : UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) SystemException(com.arjuna.wst.SystemException)

Example 12 with SystemException

use of com.arjuna.wst.SystemException in project narayana by jbosstm.

the class UserTransactionStandaloneImple method begin.

public void begin(int timeout) throws WrongStateException, SystemException {
    try {
        if (_ctxManager.currentTransaction() != null)
            throw new WrongStateException();
        Context ctx = startTransaction(timeout, null);
        _ctxManager.resume(new TxContextImple(ctx));
        enlistCompletionParticipants();
    } catch (InvalidCreateParametersException ex) {
        tidyup();
        throw new SystemException(ex.toString());
    } catch (UnknownTransactionException ex) {
        tidyup();
        throw new SystemException(ex.toString());
    } catch (SystemException ex) {
        tidyup();
        throw ex;
    }
}
Also used : Context(com.arjuna.mw.wsc11.context.Context) CoordinationContext(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext) SystemException(com.arjuna.wst.SystemException) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) WrongStateException(com.arjuna.wst.WrongStateException) TxContextImple(com.arjuna.mwlabs.wst11.at.context.TxContextImple) InvalidCreateParametersException(com.arjuna.wsc.InvalidCreateParametersException)

Example 13 with SystemException

use of com.arjuna.wst.SystemException in project narayana by jbosstm.

the class UserBusinessActivityImple method close.

public void close() throws TransactionRolledBackException, UnknownTransactionException, SystemException, WrongStateException {
    TxContextImple ctx = null;
    try {
        ctx = (TxContextImple) _ctxManager.suspend();
        if (ctx == null) {
            throw new WrongStateException();
        }
        final String id = ctx.identifier();
        final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx);
        BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
        terminatorStub.close();
    } catch (SystemException ex) {
        throw ex;
    } catch (TransactionRolledBackException ex) {
        throw ex;
    } catch (WrongStateException ex) {
        throw ex;
    } catch (UnknownTransactionException ex) {
        throw ex;
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new SystemException(ex.toString());
    } finally {
        tidyup();
    }
}
Also used : SystemException(com.arjuna.wst.SystemException) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) WrongStateException(com.arjuna.wst.WrongStateException) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) TransactionRolledBackException(com.arjuna.wst.TransactionRolledBackException) TxContextImple(com.arjuna.mwlabs.wst11.ba.context.TxContextImple) BusinessActivityTerminatorStub(com.arjuna.wst11.stub.BusinessActivityTerminatorStub) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) WrongStateException(com.arjuna.wst.WrongStateException) SystemException(com.arjuna.wst.SystemException) InvalidCreateParametersException(com.arjuna.wsc.InvalidCreateParametersException) TransactionRolledBackException(com.arjuna.wst.TransactionRolledBackException)

Example 14 with SystemException

use of com.arjuna.wst.SystemException in project narayana by jbosstm.

the class UserBusinessActivityImple method getTerminationCoordinator.

private W3CEndpointReference getTerminationCoordinator(final TxContextImple ctx) throws SystemException {
    final CoordinationContextType coordinationContext = ctx.context().getCoordinationContext();
    final String messageId = MessageId.getMessageId();
    try {
        return RegistrationCoordinator.register(coordinationContext, messageId, getParticipantProtocolService(ctx.identifier(), ctx.isSecure()), com.arjuna.webservices.wsarjtx.ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION);
    } catch (final Throwable th) {
        throw new SystemException(wstxLogger.i18NLogger.get_mwlabs_wst11_ba_remote_UserBusinessActivityImple_3());
    }
}
Also used : SystemException(com.arjuna.wst.SystemException) CoordinationContextType(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)

Example 15 with SystemException

use of com.arjuna.wst.SystemException in project narayana by jbosstm.

the class UserBusinessActivityImple method cancel.

public void cancel() throws UnknownTransactionException, SystemException, WrongStateException {
    TxContextImple ctx = null;
    try {
        ctx = (TxContextImple) _ctxManager.suspend();
        if (ctx == null) {
            throw new WrongStateException();
        }
        final String id = ctx.identifier();
        final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx);
        BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
        terminatorStub.cancel();
    } catch (SystemException ex) {
        throw ex;
    } catch (WrongStateException ex) {
        throw ex;
    } catch (UnknownTransactionException ex) {
        throw ex;
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new SystemException(ex.toString());
    } finally {
        tidyup();
    }
}
Also used : SystemException(com.arjuna.wst.SystemException) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) WrongStateException(com.arjuna.wst.WrongStateException) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) TxContextImple(com.arjuna.mwlabs.wst11.ba.context.TxContextImple) BusinessActivityTerminatorStub(com.arjuna.wst11.stub.BusinessActivityTerminatorStub) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) WrongStateException(com.arjuna.wst.WrongStateException) SystemException(com.arjuna.wst.SystemException) InvalidCreateParametersException(com.arjuna.wsc.InvalidCreateParametersException) TransactionRolledBackException(com.arjuna.wst.TransactionRolledBackException)

Aggregations

SystemException (com.arjuna.wst.SystemException)74 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)63 WrongStateException (com.arjuna.wst.WrongStateException)45 TransactionRolledBackException (com.arjuna.wst.TransactionRolledBackException)39 InvalidCreateParametersException (com.arjuna.wsc.InvalidCreateParametersException)20 ArrayList (java.util.ArrayList)19 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)16 UserBusinessActivity (com.arjuna.mw.wst11.UserBusinessActivity)15 SoapFault (com.arjuna.webservices.SoapFault)15 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)13 TxContextImple (com.arjuna.mwlabs.wst11.at.context.TxContextImple)11 TxContextImple (com.arjuna.mwlabs.wst11.ba.context.TxContextImple)11 MAP (org.jboss.ws.api.addressing.MAP)11 CoordinationContext (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext)10 Context (com.arjuna.mw.wsc11.context.Context)6 FaultedException (com.arjuna.wst.FaultedException)6 BusinessActivityTerminator (com.arjuna.wst11.BusinessActivityTerminator)6 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)6 TxContext (com.arjuna.mw.wst.TxContext)5 BusinessActivityManager (com.arjuna.mw.wst11.BusinessActivityManager)5