Search in sources :

Example 1 with ParticipantCompletionParticipantEngine

use of com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine in project narayana by jbosstm.

the class BAParticipantRecoveryRecord method activate.

/**
 * create a participant engine to manage commit or rollback processing for the
 * participant and install it in the active participants table
 */
public void activate() {
    if (isParticipantCompletion) {
        ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, endpoint, participant, State.STATE_COMPLETED, true);
        ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, getId());
        engine.recovery();
    } else {
        BusinessAgreementWithCoordinatorCompletionParticipant coordinatorCompletionParticipant = (BusinessAgreementWithCoordinatorCompletionParticipant) participant;
        CoordinatorCompletionParticipantEngine engine = new CoordinatorCompletionParticipantEngine(id, endpoint, coordinatorCompletionParticipant, State.STATE_COMPLETED, true);
        CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, getId());
        engine.recovery();
    }
}
Also used : BusinessAgreementWithCoordinatorCompletionParticipant(com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant) ParticipantCompletionParticipantEngine(com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine) CoordinatorCompletionParticipantEngine(com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine)

Example 2 with ParticipantCompletionParticipantEngine

use of com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine in project narayana by jbosstm.

the class BAParticipantProcessor method participantCancelCompletedRace.

/**
 * Execute the ParticipantCancelCompletedRace
 * @param map The current addressing context.
 *
 * @throws SoapFault11 for errors during processing
 */
public void participantCancelCompletedRace(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault11 {
    try {
        final CompletedParticipant participant = new CompletedParticipant();
        final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString());
        participant.setEngine(engine);
        participant.initialiseTimeout();
    } catch (final Throwable th) {
        throw new SoapFault11(th);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ParticipantCompletionParticipantEngine(com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine) CompletedParticipant(com.jboss.transaction.txinterop.webservices.bainterop.participant.CompletedParticipant) SoapFault11(com.arjuna.webservices11.SoapFault11)

Example 3 with ParticipantCompletionParticipantEngine

use of com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine in project narayana by jbosstm.

the class BusinessActivityManagerImple method enlistForBusinessAgreementWithParticipantCompletion.

public BAParticipantManager enlistForBusinessAgreementWithParticipantCompletion(BusinessAgreementWithParticipantCompletionParticipant bap, String id) throws WrongStateException, UnknownTransactionException, SystemException {
    final QName service = BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_QNAME;
    final QName endpoint = BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_PORT_QNAME;
    try {
        boolean isSecure = ((TxContextImple) currentTransaction()).isSecure();
        final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
        final String address = serviceRegistry.getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, isSecure);
        final W3CEndpointReference participant = getParticipant(service, endpoint, address, id);
        W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
        final ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, baPMEndpoint, bap);
        ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id);
        return new BAParticipantCompletionParticipantManagerStub(engine);
    } catch (com.arjuna.wsc.InvalidProtocolException ex) {
        throw new SystemException(ex.toString());
    } catch (com.arjuna.wsc.InvalidStateException ex) {
        throw new WrongStateException();
    } catch (com.arjuna.wsc.CannotRegisterException ex) {
        throw new UnknownTransactionException();
    } catch (Throwable ex) {
        ex.printStackTrace();
        throw new SystemException(ex.toString());
    }
}
Also used : ParticipantCompletionParticipantEngine(com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine) QName(javax.xml.namespace.QName) TxContextImple(com.arjuna.mwlabs.wst11.ba.context.TxContextImple) BAParticipantCompletionParticipantManagerStub(com.arjuna.wst11.stub.BAParticipantCompletionParticipantManagerStub) CannotRegisterException(com.arjuna.wsc.CannotRegisterException) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) ServiceRegistry(com.arjuna.webservices11.ServiceRegistry)

Example 4 with ParticipantCompletionParticipantEngine

use of com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine in project narayana by jbosstm.

the class BAParticipantProcessor method fail.

/**
 * Execute the Fail
 * @param map The current addressing context.
 *
 * @throws SoapFault11 for errors during processing
 */
public void fail(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault11 {
    try {
        final FailParticipant participant = new FailParticipant();
        final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString());
        participant.setEngine(engine);
        participant.initialiseTimeout();
    } catch (final Throwable th) {
        throw new SoapFault11(th);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ParticipantCompletionParticipantEngine(com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine) FailParticipant(com.jboss.transaction.txinterop.webservices.bainterop.participant.FailParticipant) SoapFault11(com.arjuna.webservices11.SoapFault11)

Example 5 with ParticipantCompletionParticipantEngine

use of com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine in project narayana by jbosstm.

the class BAParticipantProcessor method unsolicitedComplete.

/**
 * Execute the UnsolicitedComplete
 * @param map The current addressing context.
 *
 * @throws SoapFault11 for errors during processing
 */
public void unsolicitedComplete(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault11 {
    try {
        final CompletedParticipant participant = new CompletedParticipant();
        final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString());
        participant.setEngine(engine);
        participant.initialiseTimeout();
    } catch (final Throwable th) {
        throw new SoapFault11(th);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ParticipantCompletionParticipantEngine(com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine) CompletedParticipant(com.jboss.transaction.txinterop.webservices.bainterop.participant.CompletedParticipant) SoapFault11(com.arjuna.webservices11.SoapFault11)

Aggregations

ParticipantCompletionParticipantEngine (com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine)10 Uid (com.arjuna.ats.arjuna.common.Uid)6 SoapFault11 (com.arjuna.webservices11.SoapFault11)6 CompletedParticipant (com.jboss.transaction.txinterop.webservices.bainterop.participant.CompletedParticipant)4 CoordinatorCompletionParticipantEngine (com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine)2 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)2 TxContextImple (com.arjuna.mwlabs.wst11.ba.context.TxContextImple)1 ServiceRegistry (com.arjuna.webservices11.ServiceRegistry)1 TerminationCoordinatorProcessor (com.arjuna.webservices11.wsarjtx.processors.TerminationCoordinatorProcessor)1 CompletionCoordinatorProcessor (com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor)1 ParticipantProcessor (com.arjuna.webservices11.wsat.processors.ParticipantProcessor)1 CoordinatorCompletionParticipantProcessor (com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor)1 ParticipantCompletionParticipantProcessor (com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor)1 CannotRegisterException (com.arjuna.wsc.CannotRegisterException)1 BusinessAgreementWithCoordinatorCompletionParticipant (com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant)1 ParticipantEngine (com.arjuna.wst11.messaging.engines.ParticipantEngine)1 BAParticipantCompletionParticipantManagerStub (com.arjuna.wst11.stub.BAParticipantCompletionParticipantManagerStub)1 FailParticipant (com.jboss.transaction.txinterop.webservices.bainterop.participant.FailParticipant)1 FailedCompensateParticipant (com.jboss.transaction.txinterop.webservices.bainterop.participant.FailedCompensateParticipant)1 QName (javax.xml.namespace.QName)1