Search in sources :

Example 1 with BAParticipantCompletionParticipantManagerStub

use of com.arjuna.wst11.stub.BAParticipantCompletionParticipantManagerStub 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)

Aggregations

TxContextImple (com.arjuna.mwlabs.wst11.ba.context.TxContextImple)1 ServiceRegistry (com.arjuna.webservices11.ServiceRegistry)1 CannotRegisterException (com.arjuna.wsc.CannotRegisterException)1 ParticipantCompletionParticipantEngine (com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine)1 BAParticipantCompletionParticipantManagerStub (com.arjuna.wst11.stub.BAParticipantCompletionParticipantManagerStub)1 QName (javax.xml.namespace.QName)1 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)1