Search in sources :

Example 6 with CoordinationContextType

use of org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType 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 7 with CoordinationContextType

use of org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType in project narayana by jbosstm.

the class UserBusinessActivityImple method getContext.

/**
 * fetch the coordination context type stashed in the current BA context implememtation
 * and use it to construct an instance of the coordination context extension type we need to
 * send down the wire to the activation coordinator
 * @param current the current AT context implememtation
 * @return an instance of the coordination context extension type
 */
private CoordinationContext getContext(TxContextImple current) {
    CoordinationContextType contextType = getContextType(current);
    CoordinationContext context = new CoordinationContext();
    context.setCoordinationType(contextType.getCoordinationType());
    context.setExpires(contextType.getExpires());
    context.setIdentifier(contextType.getIdentifier());
    context.setRegistrationService(contextType.getRegistrationService());
    return context;
}
Also used : CoordinationContextType(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType) CoordinationContext(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext)

Example 8 with CoordinationContextType

use of org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType in project narayana by jbosstm.

the class Sc007TestCase method test2_2.

/**
 * test2_2 - 2.2 Rollback
 * Participant registers for Durable2PC, initiator rolls back.
 * @throws Exception on failure.
 */
public void test2_2() throws Exception {
    final String conversationId = getConversationId();
    final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED);
    ProxyConversation.setConversationState(conversationId, state);
    try {
        final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
        final CoordinationContextType context = InteropUtil.createCoordinationContext(getSourceCoordinatorURI());
        getParticipantStub().rollback(serviceURI, context);
        final CompletionCoordinatorParticipant participant = InteropUtil.registerCompletion(context, context.getIdentifier().getValue());
        participant.rollback();
        state.waitForCompletion(0);
    } finally {
        ProxyConversation.clearConversationState(conversationId);
    }
    assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
Also used : InteropWaitState(com.jboss.transaction.wstf.interop.states.InteropWaitState) CoordinationContextType(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType) CompletionCoordinatorParticipant(com.arjuna.wst.CompletionCoordinatorParticipant)

Example 9 with CoordinationContextType

use of org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType in project narayana by jbosstm.

the class Sc007TestCase method test3_4.

/**
 * test3_4 - 3.4 EarlyReadonly
 * Tests the case of a participant initiated ReadOnly message occurring prior to the prepare phase.
 * @throws Exception on failure.
 */
public void test3_4() throws Exception {
    final String conversationId = getConversationId();
    final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
    ProxyConversation.setConversationState(conversationId, state);
    try {
        final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
        final CoordinationContextType context = InteropUtil.createCoordinationContext(getSourceCoordinatorURI());
        getParticipantStub().earlyReadonly(serviceURI, context);
        final CompletionCoordinatorParticipant participant = InteropUtil.registerCompletion(context, context.getIdentifier().getValue());
        participant.commit();
        state.waitForCompletion(0);
    } finally {
        ProxyConversation.clearConversationState(conversationId);
    }
    assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
Also used : InteropWaitState(com.jboss.transaction.wstf.interop.states.InteropWaitState) CoordinationContextType(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType) CompletionCoordinatorParticipant(com.arjuna.wst.CompletionCoordinatorParticipant)

Example 10 with CoordinationContextType

use of org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType in project narayana by jbosstm.

the class Sc007TestCase method test3_9.

/**
 * test3_9 - 3.9 RetryCommit
 * Tests recovery from a communication failure during the commit phase. Transaction commits normally.
 * @throws Exception on failure.
 */
public void test3_9() throws Exception {
    final String conversationId = getConversationId();
    final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
    ProxyConversation.setConversationState(conversationId, state);
    try {
        final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI());
        final CoordinationContextType context = InteropUtil.createCoordinationContext(getSourceCoordinatorURI());
        getParticipantStub().retryCommit(serviceURI, context);
        final CompletionCoordinatorParticipant participant = InteropUtil.registerCompletion(context, context.getIdentifier().getValue());
        participant.commit();
        state.waitForCompletion(0);
    } finally {
        ProxyConversation.clearConversationState(conversationId);
    }
    assertTrue("Conversation did not complete successfully", state.isSuccessful());
}
Also used : InteropWaitState(com.jboss.transaction.wstf.interop.states.InteropWaitState) CoordinationContextType(org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType) CompletionCoordinatorParticipant(com.arjuna.wst.CompletionCoordinatorParticipant)

Aggregations

CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)107 SoapFault11 (com.arjuna.webservices11.SoapFault11)43 MAP (org.jboss.ws.api.addressing.MAP)41 Action (javax.xml.ws.Action)38 RequestWrapper (javax.xml.ws.RequestWrapper)38 MessageContext (javax.xml.ws.handler.MessageContext)38 CompletionCoordinatorParticipant (com.arjuna.wst.CompletionCoordinatorParticipant)30 InteropWaitState (com.jboss.transaction.txinterop.interop.states.InteropWaitState)16 CoordinationContext (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext)13 TransactionRolledBackException (com.arjuna.wst.TransactionRolledBackException)12 InvalidCreateParametersException (com.arjuna.wsc.InvalidCreateParametersException)10 BusinessActivityTerminator (com.arjuna.wst.BusinessActivityTerminator)10 InteropWaitState (com.jboss.transaction.wstf.interop.states.InteropWaitState)10 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)10 TxContextImple (com.arjuna.mwlabs.wst11.at.context.TxContextImple)7 SoapFault (com.arjuna.webservices.SoapFault)6 SystemException (com.arjuna.wst.SystemException)6 SOAPEnvelope (javax.xml.soap.SOAPEnvelope)6 SOAPHeaderElement (javax.xml.soap.SOAPHeaderElement)6 TxContext (com.arjuna.mw.wst.TxContext)5