Search in sources :

Example 11 with BAInitiatorProcessor

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

the class AsyncParticipantStub method coordinatorCompleteClose.

/**
 * Send a coordinatorCompleteClose 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 coordinatorCompleteClose(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().sendCoordinatorCompleteClose(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 12 with BAInitiatorProcessor

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

the class AsyncParticipantStub method compensate.

/**
 * Send a compensate 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 compensate(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().sendCompensate(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