Search in sources :

Example 51 with SystemException

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

the class UserTransactionImple method enlistCompletionParticipants.

/*
	 * Not sure if this is right as it doesn't map to registering a participant
	 * with the coordinator.
	 */
private final void enlistCompletionParticipants() throws WrongStateException, UnknownTransactionException, SystemException {
    TransactionManagerImple tm = (TransactionManagerImple) TransactionManager.getTransactionManager();
    final TxContextImple currentTx = (TxContextImple) tm.currentTransaction();
    if (currentTx == null)
        throw new UnknownTransactionException();
    final String id = currentTx.identifier();
    final W3CEndpointReference completionParticipant = getCompletionParticipant(id, currentTx.isSecure());
    W3CEndpointReference completionCoordinator = null;
    try {
        completionCoordinator = tm.registerParticipant(completionParticipant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION);
    } catch (com.arjuna.wsc.InvalidProtocolException ex) {
        ex.printStackTrace();
        throw new SystemException(ex.toString());
    } catch (com.arjuna.wsc.InvalidStateException ex) {
        throw new WrongStateException();
    } catch (com.arjuna.wsc.CannotRegisterException ex) {
        // cause could actually be no activity or already registered
        throw new UnknownTransactionException();
    }
    _completionCoordinators.put(id, completionCoordinator);
}
Also used : UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) SystemException(com.arjuna.wst.SystemException) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) WrongStateException(com.arjuna.wst.WrongStateException) TxContextImple(com.arjuna.mwlabs.wst11.at.context.TxContextImple)

Example 52 with SystemException

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

the class BusinessActivityTerminatorImple method complete.

/**
 * Complete doesn't mean go away, it just means that all work you need to
 * accomplish the commit/rollback has been received.
 */
public void complete() throws UnknownTransactionException, SystemException {
    try {
        if (_hier == null)
            throw new UnknownTransactionException();
        _coordManager.resume(_hier);
        _coordManager.complete();
    } 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.exceptions.NoCoordinatorException ex) {
        throw new UnknownTransactionException();
    } catch (com.arjuna.mw.wsas.exceptions.SystemException ex) {
        throw new SystemException();
    } catch (UnknownTransactionException ex) {
        throw ex;
    }
}
Also used : UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) SystemException(com.arjuna.wst.SystemException)

Example 53 with SystemException

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

the class BAParticipantManagerImple method cannotComplete.

public void cannotComplete() throws WrongStateException, UnknownTransactionException, SystemException {
    if (wstxLogger.logger.isTraceEnabled()) {
        wstxLogger.logger.trace(getClass().getSimpleName() + ".cannotComplete. Participant id: " + _participantId);
    }
    try {
        if (_hier == null)
            throw new UnknownTransactionException();
        _coordManager.resume(_hier);
        _coordManager.participantCannotComplete(_participantId);
        _coordManager.suspend();
    } catch (final InvalidActivityException iae) {
        throw new SystemException("UnknownTransactionException");
    } catch (final UnknownTransactionException ute) {
        throw new SystemException("UnknownTransactionException");
    } catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex) {
        throw new SystemException("UnknownParticipantException");
    } catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex) {
        throw new WrongStateException();
    } catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex) {
        throw new SystemException("UnknownTransactionException");
    } catch (com.arjuna.mw.wsas.exceptions.SystemException ex) {
        throw new SystemException(ex.toString());
    }
}
Also used : InvalidActivityException(com.arjuna.mw.wsas.exceptions.InvalidActivityException) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) SystemException(com.arjuna.wst.SystemException) WrongStateException(com.arjuna.wst.WrongStateException)

Example 54 with SystemException

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

the class BAParticipantManagerImple method completed.

public void completed() throws WrongStateException, UnknownTransactionException, SystemException {
    if (wstxLogger.logger.isTraceEnabled()) {
        wstxLogger.logger.trace(getClass().getSimpleName() + ".completed. Participant id: " + _participantId);
    }
    try {
        if (_hier == null)
            throw new UnknownTransactionException();
        _coordManager.resume(_hier);
        _coordManager.participantCompleted(_participantId);
        _coordManager.suspend();
    } catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex) {
        throw new UnknownTransactionException();
    } catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex) {
        throw new SystemException("UnknownParticipantException");
    } catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex) {
        throw new WrongStateException();
    } catch (InvalidActivityException ex) {
        throw new UnknownTransactionException();
    } catch (com.arjuna.mw.wsas.exceptions.SystemException ex) {
        throw new SystemException(ex.toString());
    }
}
Also used : InvalidActivityException(com.arjuna.mw.wsas.exceptions.InvalidActivityException) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) SystemException(com.arjuna.wst.SystemException) WrongStateException(com.arjuna.wst.WrongStateException)

Example 55 with SystemException

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

the class UserBusinessActivityImple method beginSubordinate.

public void beginSubordinate(int timeout) throws WrongStateException, SystemException {
    try {
        TxContext current = _ctxManager.currentTransaction();
        if ((current == null) || !(current instanceof TxContextImple))
            throw new WrongStateException();
        TxContextImple currentImple = (TxContextImple) current;
        Context ctx = startTransaction(timeout, currentImple);
        _ctxManager.resume(new TxContextImple(ctx));
    // n.b. we don't enlist the subordinate transaction for completion
    // that ensures that any attempt to commit or rollback will fail
    } catch (com.arjuna.wsc.InvalidCreateParametersException ex) {
        tidyup();
        throw new SystemException(ex.toString());
    } catch (com.arjuna.wst.UnknownTransactionException ex) {
        tidyup();
        throw new SystemException(ex.toString());
    } catch (SystemException ex) {
        tidyup();
        throw ex;
    }
}
Also used : TxContext(com.arjuna.mw.wst.TxContext) Context(com.arjuna.mw.wsc11.context.Context) CoordinationContext(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext) InvalidCreateParametersException(com.arjuna.wsc.InvalidCreateParametersException) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException) SystemException(com.arjuna.wst.SystemException) WrongStateException(com.arjuna.wst.WrongStateException) TxContext(com.arjuna.mw.wst.TxContext) TxContextImple(com.arjuna.mwlabs.wst11.ba.context.TxContextImple)

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