Search in sources :

Example 1 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method participantCompleteClose.

/**
 * Send a participantCompleteClose request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void participantCompleteClose(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendParticipantCompleteClose(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 2 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method mixedOutcome.

/**
 * Send a mixedOutcome request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void mixedOutcome(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendMixedOutcome(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 3 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method cancel.

/**
 * Send a cancel request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void cancel(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendCancel(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 4 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method participantCancelCompletedRace.

/**
 * Send a participantCancelCompletedRace request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void participantCancelCompletedRace(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendParticipantCancelCompletedRace(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 5 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method fail.

/**
 * Send a fail request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void fail(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendFail(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Aggregations

BAInitiatorProcessor (com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor)12 MAP (org.jboss.ws.api.addressing.MAP)12